Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个以包含更新时间戳的列结束的集合,有时作为文本字段,有时作为日期字段。我正在寻找执行查询的语法,以查找包含该字段作为日期类型的所有行。
你可以$type 使用$not
$type
$not
检查not场景。如果类型不是字符串,则考虑该文档。
not
操场
db.collection.find({ "key": { $not: { $type: "string" } } })