globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Array Filters not implemented #179

Closed JeremyLoy closed 6 years ago

JeremyLoy commented 6 years ago

Related MongoDB Documentation

We have a need to update only a subset of an array. This capability exists in MongoDB as an Array Filter, however that functionality doesn't seem to be exposed in this SDK.

globalsign/mgo/updateOp would need to be updated. In order to maintain backwards compatibility, new UpdateX methods would need to be made as changing the signatures would be required. Alternatively, some sort of builder pattern could be exposed.

domodwyer commented 6 years ago

Hi @JeremyLoy

I'm pretty sure the $filter can be part of the selector but don't use it myself - a quick google turned this up - does it work for you?

Dom

domodwyer commented 6 years ago

Ah sorry, different filter! Looks like you're right, it'll probably need an addition to the API.

We're always happy to have a look over a PR!

Dom

crhntr commented 6 years ago

I believe this issue can be closed. Let me know if there is anything left to do.

sergiolpf commented 6 years ago

when is this being released?