I have some problems with distinct queries.
db.sessions.distinct("tests.device_serial")
[
"",
"5b34f4bf9854a",
"5b34f4bf98664",
"5b34f4bf98712",
"5b34f4bf9876b",
"5b34f4bf987c6"
]
I don't want to get the result with empty strings. I tried to run query:
db.sessions.distinct("tests.device_serial", {"tests.device_serial" : {$ne: ""}})
[ ]
Why I got empty array? Where is my mistake?