Posts

Showing posts from December, 2013

Sequence concept implementation in mongo using pymongo & python

Sequence concept implementation in mongo using pymongo & python import pymongo # define the function that able to generate sequence number def getNextSequence(seq_name):     connection = pymongo.Connection("mongodb://localhost",                                     safe=True)        db = connection.test     sequence = db.sequences     sequencenext = sequence.find_and_modify(query={'seq_name':seq_name},                                        update={'$inc':{'sequence':1}},             ...