Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PagingQuery ¶
type PagingQuery interface { // Find set the filter for query results. Find(criteria interface{}) PagingQuery // Sort used to do sorting for query results according to sort field. // The sort field may contain two parts, // prefix {{-}} or {{+}}, represents ascending or descending order and // fieldname {{document field name}} which need to be indexed. // Default: -_id Sort(field string) PagingQuery // Limit is to set the maximun number of documents to be retrieved. // There is not default limit. Limit(count uint) PagingQuery // Select used to enable fields which should be retrieved. Select(selector interface{}) PagingQuery // Cursor is used to do pagination for document query. // Documents can be retrieved from that cursor value. Cursor(lastCursorValue string) PagingQuery // Decode will run the command to database and return result as []bson.Raw and error Decode(ctx context.Context) (result []bson.Raw, cursor string, err error) // Explain is to print out prepared query for command. Explain() string }
PagingQuery is to construct mongo find command (https://docs.mongodb.com/manual/reference/command/find/#dbcmd.find). And, it will return cursor id (value of sorting field from last document) and result as []bson.Raw
Click to show internal directories.
Click to hide internal directories.