Document in Collection doesn't show searching for Phone Number

Hello @Ewan_Spence, welcome to the MongoDB community forum!

By looking at what you had posted it is difficult to say what the issue is. But, you can try to find the data type of the phoneNo field. The following aggregation query prints the data type of the field:

db.callers.aggregate([
  { $match: { fullName: "John Doe" } },
  { $addFields: { phoneDataType: { $type: "$phoneNo" } } }
])

As per your posted information it should return phoneDataType: "string". Let me know.

1 Like