[CSHARP-753] Allow >, >=, <, <= comparison on array size Created: 07/Jun/13  Updated: 02/Apr/15  Resolved: 17/Feb/14

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.8.1
Fix Version/s: 1.9

Type: New Feature Priority: Minor - P4
Reporter: Pete Smith Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

C#, .NET 4.5, Linq



 Description   

Noticed when trying to build a query that only equals and not equals is supported. It is possible to implement this using JohnnyHK's answer from this post:

http://stackoverflow.com/questions/7811163/in-mongo-db-how-do-i-find-documents-where-array-size-is-greater-than-1

// Find all docs that have at least a second name array element.
db.accommodations.find({'name.1': {$exists: true}})



 Comments   
Comment by Githook User [ 17/Feb/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-753: Added Pete Smith to the contributors list.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/b5cefe92c82df537617417321a10cab77bb9ef9d

Comment by Githook User [ 17/Feb/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-753: Added unit tests for List length queries.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/52f3c30abf9dbfae68394a9294c1b3e3afb29cd1

Comment by Githook User [ 17/Feb/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-753: Added SizeLessThan and SizeLessThanOrEqual.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/6f590838fed05c69449d1fd2e1b4a70a39ab1086

Comment by Githook User [ 17/Feb/14 ]

Author:

{u'username': u'Roysvork', u'name': u'Pete Smith', u'email': u'roysvork@gmail.com'}

Message: CSHARP-753: Implemented >, >=, <, <= comparisons against array size
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/3c01537754139ac392ebbee028ac5d42b3a857d7

Comment by Craig Wilson [ 12/Jun/13 ]

Interesting idea. We'll definitely consider this.

Generated at Wed Feb 07 21:37:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.