1

可能重复:
没有 _id 字段的 mongoexport

使用 mongoexport 时如何删除 _Id 字段?

$ ./mongo
MongoDB shell 版本:2.2.2
连接到:test
> db.coll.insert( {first: "John", last: "Doe"} )
> exit
$./mongoexport --db test --collection coll --out out.json --fields '第一,最后'

out.json:

{“_id”:{“$oid”:“50bc20b3cef5182e2a788fc9”},“first”:“John”,“last”:“Doe”}

代替:

{“第一个”:“约翰”,“最后一个”:“Doe”}

4

1 回答 1

-2

你不能。_id 总是包括在内!

于 2012-12-03T05:02:13.063 回答