I'd like to query for all documents in my collection where the field client
is an empty string. I've seen plenty of examples of how to check if something's not an empty string but I can't find any examples of how to do the opposite. I've tried db.collection.find({client: ""})
but I get back an empty set.
EDIT: The example entry in the collection looks like
{ "_id" : ObjectId("54eb59699e12a795078b80da"), "reportID" : "1472031", "orgID" : "336", "client" : "", "customerID" : NumberLong(1), "address" : "123 main st", "city" : "Grove City", "state" : "OH", "zip" : "43123", "county" : "Franklin", "gpsLatitude" : null, "gpsLongitude" : null, "dateDue" : ISODate("2012-08-18T00:00:00Z"), "dateDueClient" : ISODate("2012-08-18T00:00:00Z"), "dateComplete" : ISODate("2012-08-18T00:00:00Z"), "dateCompleteEstimate" : NumberLong(0), "contractorSubmissionDate" : ISODate("2012-08-19T00:26:23Z"), "createdOn" : ISODate("2012-08-19T00:21:37Z"), "assignedToContractorOn" : ISODate("2012-08-19T00:21:37Z"), "workTypeID" : "6338", "assignedAdmin" : "7880", "contractorID" : "7880", "categoryID" : "0", "historyLength" : NumberLong(0), "invoiceDate" : ISODate("2012-08-18T00:00:00Z"), "submittedToClient" : ISODate("2012-08-18T00:00:00Z"), "paymentContractor" : NumberLong(0), "paymentClient" : NumberLong(0), "contractorIsPaid" : NumberLong(0), "clientIsPaid" : NumberLong(0), "sentinel" : NumberLong(1), "isFrozen" : NumberLong(0), "numTimesClientReady" : "1", "pcrResponses" : [ ] }
There's a lot of fields but the client one is pretty close to the beginning.