Function createCollection

  • Create a collection to store json documents and you can specify the index to accelerate query speed

    const index1:Index = {
    path:'/city', // a top level field name 'city' and the path will be '/city'
    indexType: IndexType.StringKey
    const {collection, result} = await createCollection(db, "test_collection", [index1])

    current all supported index types are 'IndexType.Uniquekey' , 'IndexType.StringKey', 'IndexType.Int64key' and 'IndexType.Doublekey'


    • db: Database

      the instance of database

    • name: string

      the name of collection

    • Optional indexFields: Index[]

      the fields for Index

    Returns Promise<CreateCollectionResult>

    the CreateCollectionResult

Generated using TypeDoc