API 参考
    正在准备搜索索引...

    接口 ReplaceOneModel<TSchema>

    interface ReplaceOneModel<TSchema extends Document = Document> {
        collation?: CollationOptions;
        filter: Filter<TSchema>;
        hint?: Hint;
        replacement: WithoutId<TSchema>;
        upsert?: boolean;
    }

    类型参数

    索引

    属性

    collation?: CollationOptions

    Specifies a collation.

    filter: Filter<TSchema>

    The filter to limit the replaced document.

    hint?: Hint

    The index to use. If specified, then the query system will only consider plans using the hinted index.

    replacement: WithoutId<TSchema>

    The document with which to replace the matched document.

    upsert?: boolean

    When true, creates a new document if no document matches the query.