MongoDB Stitch - How to keep datatype to int (without changing to double) when incremented with update?
问题 I am using stitch in mongodb. In stitch, i write one nodejs function for increment and decrements purpose. if(changeEvent.fullDocument.type == 'article' || changeEvent.fullDocument.type == 'poll' ) { context.functions.execute("notifyTopic", "article-created", changeEvent.fullDocument); var communities = context.services.get("mongodb-atlas").db("utilo").collection("communities"); communities.updateOne( {_id:changeEvent.fullDocument.community}, {$inc: {"summary.postCount":NumberInt(1)},