mongo对象转义Mongo无法存储带有'$'或'.'的文档。在钥匙。鼓励用Unicode全角等价物U+FF04(即“$”)和U+FF0E(即“.”)替换。该库根据该约定对对象的键进行转义和取消转义,从每个对象返回一个新对象。有关示例,请参阅。应用程序接口var mongoObject = require ( 'mongo-object-escape' ) ; var escapedDocToWrite = mongoObject . escape ( userInput ) ; var unescapedDocToRead = mongoObject . unescape ( escapedDocToWrite ) ;