- Collection
Collection operations supported by the driver.
- createAstraUri(apiEndpoint, applicationToken, namespace, baseApiPath, logLevel, authHeaderName) ⇒
Create an Astra connection URI while connecting to Astra Data API
- createStargateUri(baseUrl, baseAuthUrl, keyspace, username, password, logLevel) ⇒
Create a Data API connection URI while connecting to Open source Data API
- getStargateAccessToken(authUrl, username, password) ⇒
Get an access token from Stargate (this is useful while connecting to open source Data API)
Collection operations supported by the driver.
Kind: global class
- Collection
.count().count(filter)- .countDocuments(filter)
- .find(filter, options, callback)
- .findOne(filter, options)
- .insertOne(doc)
- .insertMany(documents, options)
- .findOneAndUpdate(filter, update, options)
- .findOneAndDelete(filter, options)
- .findOneAndReplace(filter, newDoc, options)
- .deleteMany(filter)
- .deleteOne(filter, options, callback)
- .updateOne(filter, update, options)
- .updateMany(filter, update, options)
- .bulkWrite(ops, options)
- .aggregate(pipeline, options)
- .bulkSave(docs, options)
- .cleanIndexes(options)
- .listIndexes(options)
- .createIndex(fieldOrSpec, options)
- .dropIndexes()
- .watch()
- .distinct()
- .estimatedDocumentCount()
- .replaceOne()
- .syncIndexes()
Deprecated
Kind: instance method of Collection
Deprecated
Count documents in the collection that match the given filter. Use countDocuments() instead.
Kind: instance method of Collection
Param |
---|
filter |
Count documents in the collection that match the given filter.
Kind: instance method of Collection
Param |
---|
filter |
Find documents in the collection that match the given filter.
Kind: instance method of Collection
Param |
---|
filter |
options |
callback |
Find a single document in the collection that matches the given filter.
Kind: instance method of Collection
Param |
---|
filter |
options |
Insert a single document into the collection.
Kind: instance method of Collection
Param |
---|
doc |
Insert multiple documents into the collection.
Kind: instance method of Collection
Param |
---|
documents |
options |
Update a single document in a collection.
Kind: instance method of Collection
Param |
---|
filter |
update |
options |
Find a single document in the collection and delete it.
Kind: instance method of Collection
Param |
---|
filter |
options |
Find a single document in the collection and replace it.
Kind: instance method of Collection
Param |
---|
filter |
newDoc |
options |
Delete one or more documents in a collection that match the given filter.
Kind: instance method of Collection
Param |
---|
filter |
Delete a single document in a collection that matches the given filter.
Kind: instance method of Collection
Param |
---|
filter |
options |
callback |
Update a single document in a collection that matches the given filter.
Kind: instance method of Collection
Param |
---|
filter |
update |
options |
Update multiple documents in a collection that match the given filter.
Kind: instance method of Collection
Param |
---|
filter |
update |
options |
Bulk write not supported.
Kind: instance method of Collection
Param |
---|
ops |
options |
Aggregate not supported.
Kind: instance method of Collection
Param |
---|
pipeline |
options |
Bulk Save not supported.
Kind: instance method of Collection
Param |
---|
docs |
options |
Clean indexes not supported.
Kind: instance method of Collection
Param |
---|
options |
List indexes not supported.
Kind: instance method of Collection
Param |
---|
options |
Create index not supported.
Kind: instance method of Collection
Param |
---|
fieldOrSpec |
options |
Drop indexes not supported.
Kind: instance method of Collection
Watch operation not supported.
Kind: instance method of Collection
Distinct operation not supported.
Kind: instance method of Collection
Estimated document count operation not supported.
Kind: instance method of Collection
Replace one operation not supported.
Kind: instance method of Collection
Sync indexes operation not supported.
Kind: instance method of Collection
Create an Astra connection URI while connecting to Astra Data API
Kind: global function
Returns:
URL as string
Param | Description |
---|---|
databaseId | the database id of the Astra database |
region | the region of the Astra database |
keyspace | the keyspace to connect to |
applicationToken | an Astra application token |
baseApiPath | baseAPI path defaults to /api/json/v1 |
logLevel | an winston log level (error: 0, warn: 1, info: 2, http: 3, verbose: 4, debug: 5, silly: 6) |
authHeaderName |
Create a Data API connection URI while connecting to Open source Data API
Kind: global function
Returns:
URL as string
Param | Description |
---|---|
baseUrl | the base URL of the Data API |
baseAuthUrl | the base URL of the Data API auth (this is generally the Stargate Coordinator auth URL) |
keyspace | the keyspace to connect to |
username | the username to connect with |
password | the password to connect with |
logLevel | an winston log level (error: 0, warn: 1, info: 2, http: 3, verbose: 4, debug: 5, silly: 6) |
Get an access token from Stargate (this is useful while connecting to open source Data API)
Kind: global function
Returns:
access token as string
Param | Description |
---|---|
username | Username |
password | Password |