$ne $type unexpected result

Hi,
I am trying to combine $ne with $type and go strange results.
M001 atlas cluster.
db: video

query 1:
db.movies.count() => 1029440 (ok)
db.movies.count({ year: {$type:‘long’} }) => 0 (ok)
db.movies.count({ year: {$type:‘int’} }) => 1029440 (ok)
db.movies.count({ year: {$ne: {$type:‘int’}} }) => 1029440 (wtf?)

Is $ne not working with $type as expected?


Problem solved - $not instead of $ne should be used with $type

1 Like