Releases: GetmeUK/MongoFrames
Projected keys in '$sub' or 'Ssub.' projections are now convered to full paths within the projection.
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
1.2.14 Fix for delete_many update_many post event hooks
Added support for mongo keywords in projects
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.
Fixed issue where empty dictionaries were not converted to SubFrame instances
1.2.12 Version bump
Fix to allow $meta projections
1.2.11 Fix to allow $meta projections
Fix for pymongo version in dependencies
As Collation is now passed through the standard mongoframes import the pymongo dependency need to be updated (thanks to the @TheGent for flagging this).
Additional pymongo pass-throughs in the base __init__
Added additional pymongo pass-thoughs in the base init for convenience: Collation, GEOSPHERE, TEXT.
Fixes for nullify and pull
Nullify and pull now work as documented (and intended).
Support for sorting shortcuts
New features
- The
$sub.projection keyword now supports for dictionaries containing list values not just dictionary values. - New functionality added to make sort by instructions easier to define, e.g:
articles = Article.many(Q.published == True, sort=SortBy(Q.published_date.desc, Q.title))Requirements update
Updated the setup requirements to use Faker which was renamed from fake-factory.