Montage
1.0

Selecting data

Get

Get a single document by its primary key

Query('movies').get('08d56946-372d-4e7f-b227-157f6d70f84f')
new Query('movies').get('08d56946-372d-4e7f-b227-157f6d70f84f')

Get all

Get all documents where the given value matches the requested index

Query('movies').get_all(
    '08d56946-372d-4e7f-b227-157f6d70f84f',
    '8a1c7d43-419c-4ee7-81f4-47f7c7583f9e'
)
new Query('movies').getAll(
    '08d56946-372d-4e7f-b227-157f6d70f84f',
    '8a1c7d43-419c-4ee7-81f4-47f7c7583f9e'
)

Filter

Get all the documents for which the specified sequence is true

query = Query('movies').filter(
    Field('year') >= 1990,
    Field('year') <= 2000,
)
new Query('movies').getAll(
    new Field('year').gt(1990),
    new Field('year').lt(2000),
)

For more informations, see Filtering.

Between

Get all the documents where the specified index falls between two values.

query = Query('movies').between(1990, 2000, 'year')
new Query('movies').between(1990, 2000, 'year')