// Insert creates a single record
Insert creates a single record
// Insert creates a single record
func (c *Collection) Insert(ctx context.Context, document interface{}) (*CollectionInsertResult, error) {
	result, err := c.collection.InsertOne(ctx, document)
	if err != nil {
		return nil, wrapMongoError(err)
	}
	return &CollectionInsertResult{result.InsertedID}, nil
}
func ( c * Collection ) Insert ( ctx context . Context , document interface { } ) ( * CollectionInsertResult , error ) { result , err := c . collection . InsertOne ( ctx , document ) if err != nil { return nil , wrapMongoError ( err ) } return & CollectionInsertResult { result . InsertedID } , nil }
Insert creates a single record
Insert creates a single record