256dpi / lungo

A MongoDB compatible embeddable database and toolkit for Go.
MIT License
459 stars 15 forks source link

Added basic support to the $push operator #3

Closed amreo closed 4 years ago

amreo commented 4 years ago

Fixes #2

What do you think @256dpi?

256dpi commented 4 years ago

Technically the $addToSet operator has the same functionality but first checks if the value already exists in the document: https://docs.mongodb.com/manual/reference/operator/update/addToSet/

Maybe we can support both operators using the same code by adding a parameter to check the array before adding.

256dpi commented 4 years ago

Thanks for working on this. I'll will do the suggested changes myself..

amreo commented 4 years ago

Ok