Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. (18:27:30) Sebi: > db.user.save( {name: 'Sebi', pass: 'test', email: 'sebi@wtfstfu.org' } )
  2. > db.user.find()
  3. { "_id" : ObjectId("4d24a9f0fc29519697caf5c1"), "name" : "Sebi", "pass" : "test", "email" : "sebi@wtfstfu.org" }
  4. >
  5.  
  6. mondodb in action ;D
  7. (18:28:30) Sebi: > db.user.save( {name: 'Sebi', pass: 'test', email: 'sebi@wtfstfu.org' } )
  8. > db.user.find()
  9. { "_id" : ObjectId("4d24a9f0fc29519697caf5c1"), "name" : "Sebi", "pass" : "test", "email" : "sebi@wtfstfu.org" }
  10. > db.user.save( {name: 'Andre', pass: 'test', email: 'mail@example.com', ist_doof: true } )
  11. > db.user.find()
  12. { "_id" : ObjectId("4d24a9f0fc29519697caf5c1"), "name" : "Sebi", "pass" : "test", "email" : "sebi@wtfstfu.org" }
  13. { "_id" : ObjectId("4d24aa27fc29519697caf5c2"), "name" : "Andre", "pass" : "test", "email" : "mail@example.com", "ist_doof" : true }
  14. >
  15.  
  16. zweiter datensatz mit nem zusätzlichen attribut :D
  17. (18:33:59) Sebi: > db.user.update ( {name:"Andre"}, {$addToSet : {spielt: { $each : ['GN','STGC','WC3']}}} )
  18. > db.user.find()
  19. { "_id" : ObjectId("4d24a9f0fc29519697caf5c1"), "name" : "Sebi", "pass" : "test", "email" : "sebi@wtfstfu.org" }
  20. { "_id" : ObjectId("4d24aa27fc29519697caf5c2"), "email" : "mail@example.com", "ist_doof" : true, "name" : "Andre", "pass" : "test", "spielt" : [ "GN", "STGC", "WC3" ] }
  21. >
  22.  
  23.  
  24. keine schemas, die nerven! ;(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement