MONGO.QUERY
Gets data from your Mongo database.
Syntax
=MONGO.QUERY(Connection, Collection, QueryJSON, Target, [ResultKeys], [PageSize], [Page], [Sort], [Timeout])
Arguments
Name | Type | Description |
---|---|---|
Connection | Connection | Reference to connection used for querying. The database name is configured in the affiliated connection settings. |
Collection | String | Choose an existing collection, where the item is stored. |
QueryJSON | JSON | Define a query using a JSON cell range, which defines the object(s) to searched for. |
Target | Target | INBOX(), OUTBOX("MsgID") or a cell range where the result will be placed. Make sure the cell range is big enough or not everything is displayed. |
ResultKeys (optional) | Range | Filter the query result. |
PageSize (optional) | Number | Number of Documents to return per page. |
Page (optional) | Number | Index of page to return. |
Sort (optional) | Number or Range | Sort query result ascending or descending. Use 1 and -1 to sort by creation time, or use a JSON cell range. |
Timeout (optional) | Number | Define Timeout in seconds. |
Return
Type | Description |
---|---|
Boolean or Error | TRUE, if no error. |
Examples
A | B | C | D | E | |
---|---|---|---|---|---|
1 | Collection: | DataSet1 | |||
2 | Gender | M | |||
3 | |||||
4 | _id | PatientID | PatientName | PatientSurName | Gender |
5 | 1 | AF3 | Miller | Joe | M |
6 | 2 | CF3 | Mayer | Jim | M |
7 | 3 | AD4 | Smith | Jack | M |
Formula | Result | Comment |
---|---|---|
| TRUE | All documents in the database with the "Gender" male in the collection "TestCollection" will be shown in the range F18:N21 of the current Streamsheet. Use INBOX() as a "Target" to prevent space issues. |