I'm trying to run the following queries with the data inserted as follows. For whatever reason the $ne with 0 in the value doesn't seem to work. I tried this on both linux and mac using v2.0.4. Also ran these using the mongo shell.
Anybody have any ideas? Is this a bug or something I'm misunderstanding?
db.associated.insert({
"diskinfo" : {
"physical" : [
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 509"}
]
}})
db.associated.insert({
"diskinfo" : {
"physical" : [
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 5"},
{"merror_count" : "Count: 0"}
]
}})
db.associated.insert({
"diskinfo" : {
"physical" : [
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 0"},
{"merror_count" : "Count: 0"}
]
}})
ran these queries on the mongo shell. and got the results in the comments
db.associated.find( { "diskinfo.physical.merror_count" : { $ne : 'Count: 0'}}).count()
// Result: 0, Expected: 2
db.associated.find( { "diskinfo.physical.merror_count" : { $ne : 'Count: 509'}}).count()
// Result: 2, Expected: 2
db.associated.find( { "diskinfo.physical.merror_count" : { $ne : 'Count: 5'}}).count()
// Result: 2, Expected: 2