Skip to content

Releases: GetmeUK/MongoFrames

Support for sending keyword arguments to write commands

17 Jul 14:43
Compare
Choose a tag to compare
  • 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

06 Jun 11:36
Compare
Choose a tag to compare

Thanks to @tylerganter for the pull request to significantly improve the performance of update_many.

In this release:

  • update_many now uses bulk writes which significantly improves the performance of calling update_many.
  • unset and unset_methods have now been added to the Frame class.
  • A fix has been applied to the ElemMatch function which previously would raise an error if a raw condition was given instead of a Condition instance.

Support for with_options

16 Jan 16:08
Compare
Choose a tag to compare

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

25 May 13:01
Compare
Choose a tag to compare

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

24 Feb 22:47
Compare
Choose a tag to compare
1.3.3

Added support for $slice in sub frame projections

Fix for sub in sub projections not being inclusive

19 Feb 14:41
Compare
Choose a tag to compare
1.3.2

Fix for inclusion of fields in sub sub projections

Fix for $sub. projections

07 Feb 02:13
Compare
Choose a tag to compare
1.3.1

Fix for incorrect if test when projecting $sub.

Projected keys in '$sub' or 'Ssub.' projections are now convered to full paths within the projection.

06 Feb 23:42
Compare
Choose a tag to compare

Previous to this release projections within $sub or $sub. where simply ignored and the projection was converted to True for the key, for example:

lairs = Lair.many(
    projection={
        '_id': True,
        'inventory': {
            '$sub': Inventory,
            'gold': True
    }
)

Previously used the projection:

{
     '_id: True, 
     'inventory': True
}

In this release this will now project to:

{
     '_id: True, 
     'inventory.gold': True
}

NOTE: This release is a minor release as whilst this should effect existing code if you've previous been setting projections (which simply were ignored before) this could potentially break this code.

Fixes: updated and deleted hooks on update/delete_many methods

17 Dec 23:32
Compare
Choose a tag to compare
1.2.14

Fix for delete_many update_many post event hooks

Added support for mongo keywords in projects

15 Aug 16:39
Compare
Choose a tag to compare

For example this is now possible:

projection={
    'employees': {
        '$ref': Employee,
        '$slice': 2,
       'name': True
    }
}

So get the first 2 employee Ids in an array of employee Ids stored against the field employees and project them as Employee documents selecting only the name field for each.