You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collection.find({}, 'name' ) raises a DeprecationWarning. I see #303/#304 fixed documentation by suggesting shifting to projection, rather than fields. This will no doubt work, but the documentation changes do not appear to fully reflect reality when using an options string.
users.findOne({name: 'foo'},'name').then((doc)=>{// only the name projection will be selected});
Using monk 7.3.0, as expected findOne with fields raises a DeprecationWarning:
> collection.find({name: 'Test'}, { fields: { 'name': 1 } } );
> (node:125878) DeprecationWarning: collection.find option [fields] is deprecated and will be removed in a later version.
However, findOne appears to continue to parse an options string as fields, not projection as it raises an unexpected DeprecationWarning:
> collection.findOne({name: 'Test'}, 'name' );
> (node:126116) DeprecationWarning: collection.find option [fields] is deprecated and will be removed in a later version.
The same behaviour is experienced with find.
Is the options string expansion to fields done within monk or within mongodb? Either way, the problem should be fixed or the documentation updated to reflect reality.
This also affects the code in README.md which references passing options as a string.
The text was updated successfully, but these errors were encountered:
collection.find({}, 'name' )
raises a DeprecationWarning. I see #303/#304 fixed documentation by suggesting shifting to projection, rather than fields. This will no doubt work, but the documentation changes do not appear to fully reflect reality when using an options string.findOne
arguments documentation:findOne
example:Using
monk
7.3.0, as expectedfindOne
withfields
raises aDeprecationWarning
:findOne
withprojections
works with no issues:However,
findOne
appears to continue to parse an options string asfields
, notprojection
as it raises an unexpectedDeprecationWarning
:The same behaviour is experienced with
find
.Is the
options
string expansion tofields
done withinmonk
or within mongodb? Either way, the problem should be fixed or the documentation updated to reflect reality.This also affects the code in
README.md
which references passing options as a string.The text was updated successfully, but these errors were encountered: