📜  带有分页查询的 mongodb 存储桶 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:28.003000             🧑  作者: Mango

代码示例1
db.history.updateOne({ "_id": /^7000000_/, "count": { $lt: 1000 } },
    { 
        "$push": { 
            "history": {
                "type": "buy",
                "ticker": "MDB",
                "qty": 25,
                "date": ISODate("2018-11-02T11:43:10")
            } },
        "$inc": { "count": 1 },
        "$setOnInsert": { "_id": "7000000_1541184190" }
    },
    { upsert: true })