Reputation: 7713
Can anyone tell me why this query would return this record?
query:
db.sales.findOne({"qualified": true, created_at: {$gte:1334534400}, campaign: {$exists:1}})
record:
{
"_id" : ObjectId("4f8b6ef8da45bb3e600001fe"),
"grand_total" : 9.99,
"order_id" : "T003974723",
"items" : [
{
"price" : 9.99,
"id" : "23958754",
"name" : "UO Daisy Sunglasses",
"qty" : 1
}
],
"created_at" : 1334537675,
"visitor_id" : "1332652531389",
"unique_session_id" : "i-0f7e196e-110800",
"session_id" : "i-0f7e196e-110800",
"qualified" : true,
"needler_id" : 357,
"ip_address" : "76.103.214.29",
"in_session" : true
}
I THOUGHT I was asking mongo to give me back a record that had 'campaign' was a property. However, as you can see, this record has no property called 'campaign'
Upvotes: 1
Views: 95
Reputation: 102753
Which version of mongodb are you using? Apparently using $exists: 1 (instead of $exists: true is only supported from v1.9 on:
https://jira.mongodb.org/browse/SERVER-2322
Upvotes: 1