Hi Folks ,
I have a function
function getStudentSequence(sequenceName) {
var result = db.short_counter.findAndModify(
{
query: { _id: sequenceName },
update: { $inc: { seq: 1 } },
new: true
}
);
return result.seq;
}
I am able to execute this function with mongo shell like this
db.short.insert(
{
_id: getStudentSequence("rollNo"),
long_url: "www.google.com"
}
I would like to execute the same using pymongo from jupyter notebook.
please advice