Rename _id fields in mongo collections

1,181 views
Skip to first unread message

Stefano Liboni

unread,
Sep 19, 2011, 11:22:11 AM9/19/11
to mongod...@googlegroups.com
Hi,
I've a mongo collection which contains BsonDocument instances.
I've seen that mongo auto createsthe _id field (which is nice), but,
is there a way to tell mongo to create the same field but named "key"
or something else?
Tnx

Stefano Liboni

Robert Stam

unread,
Sep 19, 2011, 11:26:14 AM9/19/11
to mongod...@googlegroups.com
No, that behavior is only for the _id field. Furthermore, the _id field is mandatory.


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Stefano Liboni

unread,
Sep 20, 2011, 8:20:38 AM9/20/11
to mongod...@googlegroups.com
Tnk you for the answer

Stefano Liboni

2011/9/19 Robert Stam <rstam...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages