Create other autoincrement field besides the id on MongoDB

71 views
Skip to first unread message

Leonardo Tada

unread,
Jun 6, 2014, 12:08:03 AM6/6/14
to web...@googlegroups.com
I know the field id is autoincrement, but I need other field besides the id, because I'm trying to use MongoDB and the field id that created is like '{ "_id" : { "$oid" : "539139c0dfe28529f6fb72cb"}'.
Then have to create other autoincrement field besides the id.
Anybody can help?

Massimo Di Pierro

unread,
Jun 8, 2014, 12:38:56 AM6/8/14
to web...@googlegroups.com
If you use db = DAL('mongodb:...')

tables get automatically an integer "id" field. It is not auto-increment and it is stored as a UUID by mongo. web2py converts the UUID to an integer and back so that web2py does not break.

Leonardo Tada

unread,
Jun 13, 2014, 1:50:11 PM6/13/14
to web...@googlegroups.com
I understood, but have a way to make other field like auto-increment?
Reply all
Reply to author
Forward
0 new messages