[DOCS-2181] Mixed type comparison rules Created: 01/Nov/13  Updated: 19/Aug/14  Resolved: 19/Aug/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.10

Type: Improvement Priority: Major - P3
Reporter: Andre Spiegel Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 26 weeks, 1 day ago

 Description   

I couldn't find any documentation on how mixed types compare in mongo queries. For example, if a document has

{ a: 1 }

, does the query

{ a: NumberLong(1) }

find it? I figured out by experiment that the type does not seem to matter, but would like some page to state the precise rules.

E.g. what about $gt, $ne, etc.? Does a boolean/numeric comparison ever return true? How about string/numeric?

Most of this is pretty straightforward and intuitive, but it needs to be specified somewhere.



 Comments   
Comment by Githook User [ 19/Aug/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-2181 add links to BSON comparison order
Branch: master
https://github.com/mongodb/docs/commit/b61fab740acf85d1c30284dca6b1fa58b7f9dbb9

Generated at Thu Feb 08 07:42:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.