amark / mongous

Simple MongoDB driver for Node.js with jQuery like syntax.
MIT License
246 stars 30 forks source link

How can i add field? #40

Closed will0321 closed 9 years ago

will0321 commented 9 years ago

i have a record like this: {"UserName":"Will","Sex":1}. then i want to add a "Age" filed,then this record is like this:{"UserName":"Will","Sex":1,age:"30"}.

i can solve it like this : update({"UserName":"Will"},{"UserName":"Will","Sex":1,age:"30"}). but this method ,must write all fieds. In mongodb ,"update({"UserName":"Will"},{"$set" : {age:"30"}})" can add field. Mongous can add field through similars method?

amark commented 9 years ago

yes.

Is it not working? It should work. Please let me know!

will0321 commented 9 years ago

It can't work using update({"UserName":"Will"},{"$set" : {age:"30"}})

will0321 commented 9 years ago

sorry ,it is working now.

amark commented 9 years ago

Yay! Closing!

If you are looking for an easier database you might want to check out my most recent project http://github.com/amark/gun . :)