jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
286 stars 65 forks source link

Broken backwards compatibility? update appends unknown arrayFilters argument irrespective of mongodb version #116

Closed rfhb closed 6 years ago

rfhb commented 6 years ago

Continuous integration of my project with mongodb 3.2 triggers the error:

Unrecognized field in update operation: arrayFilters,

see https://travis-ci.org/rfhb/ctrdata/jobs/320570386#L1772.

I wonder if

BSON_APPEND_ARRAY (&opts, "arrayFilters", filters);

in https://github.com/jeroen/mongolite/blob/master/src/collection.c#L76 should not be appended if the mongodb version is lower than 3.6, considering that such versions are still used. Thank you.

jeroen commented 6 years ago

Ah that is certainly not intended. I have pushed a fix can you try installing the devel version?

devtools::install_github("jeroen/mongolite")

Thanks for reporting.

rfhb commented 6 years ago

Great stuff, works for me and closes #118. Many thanks.

rfhb commented 6 years ago

Great, thank you, works well for me and addresses my issue. (My feedback here from 24 Dec seems to have gone, apologies.)