Skip to content

Db

Defined in: packages/client/src/client.ts:54

new Db(http): Db

Defined in: packages/client/src/client.ts:57

HttpClient

Db

get databaseName(): string

Defined in: packages/client/src/client.ts:60

The database id (from the connection string).

string

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).

TSchema extends object = Document

string

Collection<TSchema>


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).

TSchema extends object = Document

string

WriteOptions & object = {}

Promise<Collection<TSchema>>


dropCollection(name, options?): Promise<boolean>

Defined in: packages/client/src/client.ts:110

Move a collection to “Recently deleted” in the app.

string

WriteOptions = {}

Promise<boolean>


getSchema(name): Promise<CollectionInfo>

Defined in: packages/client/src/client.ts:99

Fields, types and record count of a collection.

string

Promise<CollectionInfo>


listCollections(): ArrayCursor<CollectionInfo>

Defined in: packages/client/src/client.ts:72

ArrayCursor<CollectionInfo>


watch(): ChangeStream

Defined in: packages/client/src/client.ts:121

Follow changes in every collection.

ChangeStream

Made by Faeiz Furqan