(+N) Consulting Inc.

Consulting | Software Solutions | Training

Query Oddities – MongoDB style

Oh, I remember it like it was yesterday: Dot-com, no DBA, late nights, a pale developer walking into my office head hung low and mumbling something about restoring backup because he ran an update query with no where clause.. the good old days. Zoom forward a decade. A developer is cranking away on some MongoDB query generation in code. Not wanting to make any rookie mistakes, she uses the Query.EQ builder, which would surely create the correct syntax. Better than her own string.Format() at least! Or so she thought. The issue is a small peculiarity with the Query methods. The formal signature takes a string and a BsonValue: 1: public static QueryComplete EQ( 2: string name, 3: BsonValue value 4: ) So a some... [More]