Skip to content

Data Stores

/query

Queries the specified data store.

  • rights: get
  • verbs: GET, POST
ParameterTypeRequiredDescription
storeStringYesNames of the data stores to query
qStringYesQuery string as described below
flStringNoComma separated list of property names to return for each matching record. Default returns all properties
startlongNoThe starting record to return. Default is 0
rowslongNoNumber of records to return. Default will return 0 records
sortStringNoOrder in which to return records. A sort string is made of comma separated parts where each part is a property name followed by one of asc or desc
formatStringNoOne of csv or json. Default is json. For csv, both documents and facets cannot be returned in 1 request
POST/query

The easiest way to learn the query is by studying the following simple examples.

Return all documents:

bash
curl https://test-m1.minusonedb.com/query \
-d "store=index&q=*&rows=10" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 query -store "index" -q '*' -rows 10

The simplest query is * which will match all documents. Add a rows parameter to get data other than a count.

All events from a particular IP address:

bash
m1 test-m1 query -store "index" -q "_m1.ip:128.218.229.26"
bash
curl https://test-m1.minusonedb.com/query \
-d "store=index&q=_m1.ip:128.218.229.26" \
-H "m1-auth-token: $myToken"

To find all events from a particular ip address use a query like _m1.ip:128.218.229.26. In general, the form is property:value.

All events from 2 IP addresses:

bash
m1 test-m1 query -store "index" -q '_m1.ip:("128.218.229.26" OR "72.200.1.74")'
bash
curl https://test-m1.minusonedb.com/query \
-d "store=index&q=_m1.ip:("128.218.229.26" OR "72.200.1.74")" \
-H "m1-auth-token: $myToken"

To find all events from more than ip address, use OR to separate multiple values: _m1.ip:("128.218.229.26" OR "72.200.1.74").

More than 1 constraint:

bash
m1 test-m1 query -store "index" -q "_m1.ip:("128.218.229.26" OR "72.200.1.74") AND event.type:sessionStart"
bash
curl https://test-m1.minusonedb.com/query \
-d "store=index&q=_m1.ip:("128.218.229.26" OR "72.200.1.74") AND event.type:sessionStart" \
-H "m1-auth-token: $myToken"

To use multiple constraints, use an AND between individual property terms. The query _m1.ip:(128.218.229.26 OR 72.200.1.74) AND event.type:sessionStart will return events of type sessionStart from 2 the specified ip addresses.

Match against a range of values for a given property:

bash
m1 test-m1 query -store "index" -q "_m1.receivedUTC:[2021-12-25T00:00:00Z TO 2021-12-26T00:00:00}" -sort '_m1.receivedUTC desc'
bash
curl https://test-m1.minusonedb.com/query \
-d "store=index&q=_m1.receivedUTC:[2021-12-25T00:00:00Z TO 2021-12-26T00:00:00}&sort=_m1.receivedUTC desc" \
-H "m1-auth-token: $myToken"

Ranges let you search against a numeric or date interval: q=_m1.receivedUTC:[2021-12-25T00:00:00Z TO 2021-12-26T00:00:00Z} will return all events received on 12/25/2021. Use [] for inclusive ranges and {} for exclusive ranges.

A more complicated query:

bash
m1 test-m1 query -store "index" -q '_m1.receivedUTC:[2021-12-25T00:00:00Z TO 2021-12-26T00:00:00Z} AND (_m1.ip:"128.218.229.26") AND NOT (event.type:sessionStart)'
bash
curl https://test-m1.minusonedb.com/query \
-d 'store=index&q=_m1.receivedUTC:[2021-12-25T00:00:00Z TO 2021-12-26T00:00:00Z} AND (_m1.ip:"128.218.229.26") AND NOT (event.type:sessionStart)' \
-H "m1-auth-token: $myToken"

These simple concepts can be combined and composed to make more complicated queries. Our reports interface can help you build queries and display results.

Streaming

This is a streaming endpoint.

/index

Writes all rows in the datalake with _m1key values between start (inclusive) and end (exclusive) to the associated store. Often used when resizing a datastore.

  • rights: publish
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
startlongYesInclusive start key
endlongYesExclusive end key
POST/index
bash
curl https://test-m1.minusonedb.com/index \
-d "store=index&start=10000&end=30000" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 index -store index -start 10000 -end 30000
200 OKNo response body when successful

/store/list

Return a list of all configured data stores.

  • rights: get, admin
  • verbs: GET
ParameterTypeRequiredDescription
(none)
GET/store/list
bash
curl https://test-m1.minusonedb.com/store/list \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/list
200 OKList of data stores

/store/autocommit

Set autocommit frequency of a given store. The autocommit frequency governs how often a store makes recently written data available for searching. For most near real time use cases we recommend a value of 5; a 0 or negative value will turn off autocommit which is recommended for bulk loading use cases.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
secondsintegerYesAutocommit frequency in seconds
POST/store/autocommit
bash
curl https://test-m1.minusonedb.com/store/autocommit \
-d "store=index&seconds=2" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/autocommit -store index -seconds 2
200 OKNo response body when successful

/store/add

Add specification for a data store. You will need a corresponding /env/store/create ops service call to provision your data store servers.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
typeStringYesOne of standard or boost
shardslongYesNumber of shards in deployed store
replicaslongYesNumber of replicas in deployed store
percentdoubleNoPercentage (0 to 1); store will be sampled to this subset of all published data based on value of _m1rand
POST/store/add
bash
curl https://test-m1.minusonedb.com/store/add \
-d "store=index&shards=1&replicas=2" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/add -store index -shards 1 -replicas 2
200 OKNo response body when successful

The m1 client can help streamline operations that require coordination between https://ops.minusonedb.com and an environment.

/store/drop

Removes the specification for a data store. You will need to make a corresponding /env/store/destroy ops service call so as not to incur charges for provisioned servers.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
POST/store/drop
bash
curl https://test-m1.minusonedb.com/store/drop \
-d "store=index" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/drop -store index
200 OKNo response body when successful

The m1 client can help streamline operations that require coordination between https://ops.minusonedb.com and an environment.

/store/rename

Change the name of a data store.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
nameStringYesNew store name
POST/store/rename
bash
curl https://test-m1.minusonedb.com/store/rename \
-d "store=index&name=newStoreName" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/rename -store index -name newStoreName
200 OKNo response body when successful

The m1 client can help streamline operations that require coordination between https://ops.minusonedb.com and an environment.

/store/enable

Set the data store active status to true/false. A store set to active will be automatically updated when the data lake is updated; an inactive store will not.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
activeBooleanYesActive status
POST/store/enable
bash
curl https://test-m1.minusonedb.com/store/enable \
-d "store=index&active=true" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/enable -store index -active true
200 OKNo response body when successful

/store/backup/create

Starts a backup of the store; use /store/backup/list to monitor status of the backup.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
nameStringYesBackup name
POST/store/backup/create
bash
curl https://test-m1.minusonedb.com/store/backup/create \
-d "store=index&name=myBackup" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/backup/create -store index -name myBackup
200 OKBackup initiated

/store/backup/restore

Begins the restore process of a store from a saved backup. Any data that was previously in the store will be lost once the restore process begins. Use /health to monitor status of the restore; the store server group will require a /reboot to complete the restore process.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
storeStringYesStore name
backupStringYesID of backup
POST/store/backup/restore
bash
curl https://test-m1.minusonedb.com/store/backup/restore \
-d "store=index&backup=5ed16f63-1282-41b6-a880-67635ce5036a" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/backup/restore -store index -backup 5ed16f63-1282-41b6-a880-67635ce5036a
200 OKNo response body when successful

/store/backup/list

Return a list of all backups associated with this environment.

  • rights: admin
  • verbs: GET
ParameterTypeRequiredDescription
(none)
GET/store/backup/list
bash
curl https://test-m1.minusonedb.com/store/backup/list \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/backup/list
200 OKList of backups

/store/backup/drop

Remove the specification and all underlying backup data for a data store backup.

WARNING

This operation cannot be undone.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
backupStringYesID of backup
POST/store/backup/drop
bash
curl https://test-m1.minusonedb.com/store/backup/drop \
-d "backup=5ed16f63-1282-41b6-a880-67635ce5036a" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/backup/drop -backup 5ed16f63-1282-41b6-a880-67635ce5036a
200 OKNo response body when successful

/store/backup/rename

Change the name of a store backup.

  • rights: admin
  • verbs: POST
ParameterTypeRequiredDescription
backupStringYesID of backup
nameStringYesNew backup name
POST/store/backup/rename
bash
curl https://test-m1.minusonedb.com/store/backup/rename \
-d "backup=5ed16f63-1282-41b6-a880-67635ce5036a&name=newBackupName" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 store/backup/rename -backup 5ed16f63-1282-41b6-a880-67635ce5036a -name newBackupName
200 OKNo response body when successful
Was this page helpful?
Suggest an edit

© 2021-2026 MinusOne, Inc.