Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // select * from products where category is null
- db.products.find({
- category: {
- $exists: false
- }
- });
- // select * from products where type(category) = "string"
- db.products.find({
- category: {
- $type: "string"
- }
- });
- // select * from products where type(price) in ("int", "long")
- db.products.find({
- price: {
- $type: ["int", "long"]
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment