Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Push a item in a array
- db.alura.update(
- {"_id":ObjectId("5c8fabfae0e83c54895c973f")},
- {
- $push:{
- "cursos":{
- "nome":"convecao",
- "habilidade":"dificil"
- }
- }
- }
- )
- //Push many items in a array
- db.alura.update(
- {"_id":ObjectId("5c8fabfae0e83c54895c973f")},
- {
- $push:{
- "cursos": {
- $each:[
- {
- "nome":"sukita",
- "habilidade":"facil"
- },
- {
- "nome":"dolly",
- "habilidade":"dificil"
- }
- ]
- }
- }
- }
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement