how do I find all documents with a field that is NaN in MongoDB?

mongodb, nan

Solution

db.collection.find( { field: NaN })

actually works although I couldn't find any documentation on it

Problem

I want to delete all geospacial fields that are NaN so I can properly index my MongoDB. How do I find all documents that have this though? ``` db.collection.find( { field: {$not: { $type: 1 } } }) ``` won't work since NaN is of type Number.

Original source