Table of Contents

BigObject PolyDB::Collection

from application common

Represents a collection in PolyDB

Methods

Database Access

Core methods for connecting to the database and retrieving metadata.


get_schema()

Get a JSON validation schema for objects stored in the collection

Returns:
from extension:

Database Collection Administration

Methods to manipulate a given collection.


add_index(String name, HASH index)

Add an index to a collection

Parameters:

String name: of the index

HASH index: definition

Options:

String name: index name

from extension:

add_index_from_property(String property)

Add an index to a collection for a property

Parameters:

String property

Options:

Bool ascending: sort documents ascending wrt the property, default true

Bool unique: set true if the property is unique, default false

from extension:

add_indices(ARRAY index)

Add many indices to a collection

Parameters:

ARRAY index: definitions, must include the name of the index

from extension:

add_indices_from_properties(ARRAY property)

Add an index to a collection for a property

Parameters:

ARRAY property: names

Options:

Bool ascending: sort documents ascending wrt the property, default true

Bool unique: set true if the property is unique, default false

from extension:

get_index_names

Get a list of the names of indices defined for the collection

from extension:

get_indexes

Get a list of indices defined for the collection

from extension:

indices

FIXME list all indices defined for a collection

from extension:

insert_many(Core::BigObject array)

Insert one object into the collection

Parameters:

Core::BigObject array: of objects to be inserted

Options:
option list insert_options
from extension:

insert_one(Core::BigObject object)

Insert one object into the collection

Parameters:

Core::BigObject object: to be inserted

Options:
option list insert_one_options
from extension:

remove_all

Remove all objects from a collection matching the given filter, default is all

from extension:

remove_one(String id)

Remove one object from a collection identified by its id

Parameters:

String id: the id of the object to remove

from extension:

replace_one(Core::BigObject object)

Replaces one object in the collection based on the id

Parameters:

Core::BigObject object: to be inserted

Options:
option list insert_one_options
from extension:

set_doc(HASH doc)

Set documentation for a collection

Parameters:

HASH doc: the documentation

Options:

Bool update: default false

from extension:

set_info(HASH info, String id)

Set the info doc

Parameters:

HASH info: the info document

String id: the id of the info

from extension:

set_schema(HASH schema, String id)

Set the info doc

Parameters:

HASH schema: the schema document

String id: the id of the schema

from extension:

Database Query Operations

Methods that provide query operations for the database or manipulate the result stream of a query.


aggregate(HASH pipeline)

Run a mongodb aggregation pipeline in a collection

Parameters:

HASH pipeline: , written in Mongo query language

Options:
option list cursor_options
from extension:

count(HASH query)

Return the number of objects satisfying the given search criteria.

Parameters:

HASH query: search criteria written in Mongo query language

from extension:

count_distinct(HASH query, String property)

Count the distinct property values in objects satisfying the given search criteria.

Parameters:

HASH query: search criteria for objects to be inspected, written in Mongo query language an empty hash map will collect property values from all objects in this collection

String property: name of the property of interest

from extension:

distinct(HASH query, String property)

Retrieve a list of distinct values of a given property. The values are returned in arbitrary order.

Parameters:

HASH query: search criteria for objects to be inspected, written in Mongo query language an empty hash map will collect property values from all objects in this collection

String property: name of the property of interest

Returns:
ARRAY
from extension:

find(HASH query)

Retrieve all objects satisfying the given search criteria

Parameters:

HASH query: search criteria written in Mongo query language an empty hash map will retrieve all objects in this collection

Options:
option list cursor_options
Returns:
from extension:

find_one(HASH query)

Retrieve the first object satisfying the given search criteria.

Parameters:

HASH query: search criteria written in Mongo query language an empty hash map will retrieve a random object from this collection

Options:
option list query_options
Returns:
from extension:

sample_one(HASH query)

Return a random element matching the query

Parameters:

HASH query: search criteria for objects to be inspected, written in Mongo query language an empty hash map will collect property values from all objects in this collection

Options:
option list cursor_options
from extension:

no category

name

UNDOCUMENTED

from extension:

update_one

UNDOCUMENTED

from extension: