CreateCollection

Creates a collection.

MongoDB always automatically creates a non-existing collection on the first insert. This method is useful to customize the options of the collection.

Example

users.create {}

External resources

Constructors

Link copied to clipboard
constructor(context: BsonContext)

Properties

Link copied to clipboard

The context used to generate this expression.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun freeze()

Makes this node immutable.

Link copied to clipboard

Returns a simplified (but equivalent) expression to the current expression.

Link copied to clipboard

Writes the result of simplifying to a new BsonDocument.

Link copied to clipboard
fun toString(simplified: Boolean): String
override fun toString(): String

JSON representation of this expression.

Link copied to clipboard
override fun writeTo(writer: BsonFieldWriter)

Writes the result of simplifying this expression into writer.