Db
Defined in: packages/client/src/client.ts:54
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Db(
http):Db
Defined in: packages/client/src/client.ts:57
Parameters
Section titled “Parameters”HttpClient
Returns
Section titled “Returns”Db
Accessors
Section titled “Accessors”databaseName
Section titled “databaseName”Get Signature
Section titled “Get Signature”get databaseName():
string
Defined in: packages/client/src/client.ts:60
The database id (from the connection string).
Returns
Section titled “Returns”string
Methods
Section titled “Methods”collection()
Section titled “collection()”collection<
TSchema>(name):Collection<TSchema>
Defined in: packages/client/src/client.ts:68
A collection by API name. It doesn’t have to exist yet: the first insert creates it, with
field types guessed from the values (or create it first with createCollection).
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends object = Document
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Collection<TSchema>
createCollection()
Section titled “createCollection()”createCollection<
TSchema>(name,options?):Promise<Collection<TSchema>>
Defined in: packages/client/src/client.ts:86
Create a collection, optionally with typed fields (otherwise fields appear on insert).
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends object = Document
Parameters
Section titled “Parameters”string
options?
Section titled “options?”WriteOptions & object = {}
Returns
Section titled “Returns”Promise<Collection<TSchema>>
dropCollection()
Section titled “dropCollection()”dropCollection(
name,options?):Promise<boolean>
Defined in: packages/client/src/client.ts:110
Move a collection to “Recently deleted” in the app.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<boolean>
getSchema()
Section titled “getSchema()”getSchema(
name):Promise<CollectionInfo>
Defined in: packages/client/src/client.ts:99
Fields, types and record count of a collection.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CollectionInfo>
listCollections()
Section titled “listCollections()”listCollections():
ArrayCursor<CollectionInfo>
Defined in: packages/client/src/client.ts:72
Returns
Section titled “Returns”watch()
Section titled “watch()”watch():
ChangeStream
Defined in: packages/client/src/client.ts:121
Follow changes in every collection.
Returns
Section titled “Returns”Made by Faeiz Furqan