Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- nome: "ale",
- skills: ["mongo", "db2", "oracle"]
- },
- {
- nome: "massimo",
- skills: ["monngo", "sqlserver"]
- },
- {
- nome: "fabio",
- skills: ["db2", "mysql"]
- },
- {
- nome: "gianluca",
- skills: ["db2", "oracle"]
- },
- {
- nome: "bob",
- skills: ""
- }
- //utenti che hanno sia mongo che db2
- db.collezione.find(
- {
- skills: {$all: ["mongo", "db2"]}
- }
- )
- // utenti con almeno 3 skills
- db.collezione.find(
- {
- skills: {$size: 3}
- }
- )
- // utenti che non hanno skills
- db.collezione.find(
- {
- skills: null
- }
- )
- // oppure
- db.collezione.find(
- {
- skills: {$exists: false}
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement