Releases: GetmeUK/MongoFrames
Fix: errant print statements removed
Support for $ref_key
This release adds support for specifying a foreign key field other than the _id field when using $ref (references) in projections. To specify a different foreign key you can now use $ref_key like so:
employees = Employee.many(
projection={
'first_name': True,
'company': {
'$ref': Company,
'$ref_key': 'company_no',
'name': True
}
}
)Added support for sets in queries
1.3.8 support for sets in queries
Support for sending keyword arguments to write commands
- You can now specify kwargs when calling write commands (such as
update,insert_many, etc). - Upsert now uses a single record look up rather than a count when checking for an existing record.
Improved performance for update many, addition of unset methods and minor fix
Thanks to @tylerganter for the pull request to significantly improve the performance of update_many.
In this release:
update_manynow uses bulk writes which significantly improves the performance of calling update_many.unsetandunset_methodshave now been added to theFrameclass.- A fix has been applied to the
ElemMatchfunction which previously would raise an error if a raw condition was given instead of aConditioninstance.
Support for with_options
It's now possible to set the collection options for a frame within a given context, such as:
with MyFrame.with_options(read_preference=ReadPreference.SECONDARY):
my_frame = MyFrame.one()This release also sees a move to pymongo>=3.9.0 requirements.
Update to use pymongo 3.8 and bug fix for mongo operators in projections
This release has moved the minimum pymongo requirement to 3.8+. To support this change we've replaced a number of pymongo deprecated method calls, including update with update_one and count with count_documents or estimated_document_count. This does not change the update and count methods / API for MongoFrames.
In addition I fixed an issue where using $slice in a reference projection wasn't correctly, for example in the expression:
projection={
'name': True,
'show_date_str': True,
'leads': {
'$ref': User,
'$slice': 1,
'first_name': True,
'last_name': True
}
}This now correctly selects the first Id in the leads field to use as a reference when selecting the assoicated users
Added support for $slice in $sub projections
1.3.3 Added support for $slice in sub frame projections
Fix for sub in sub projections not being inclusive
1.3.2 Fix for inclusion of fields in sub sub projections
Fix for $sub. projections
1.3.1 Fix for incorrect if test when projecting $sub.