Cast _id: number to string
Every time I type { _id: 12345 } in the Filter, I get zero results, until I realize that I forgot the quotes. Could Compass automatically convert numeric _id values to strings before running the query?
1
vote
![](https://secure.gravatar.com/avatar/fb5e3a539b1e23c54b080b6d12b411c2?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
Susnigdha commented
If its '_id' you're looking for, your query is wrong.
If the value of 'id' is a string, then it has to be enclosed in string as its a string field, otherwise unwanted results can crop up. But for those 'id' fields which have numeric data, and matches with 12345, Compass does return the documents.