Skip to content

Added support for mongo keywords in projects

Compare
Choose a tag to compare
@anthonyjb anthonyjb released this 15 Aug 16:39
· 15 commits to master since this release

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.