I found here a nice template for a pagination. However, this example is done with SQLlite.
It seems that it is possible to do pagination with flask-mongoengine, flask-mongoalchemy and pymongo.
I created a little code with PyMongo:
from pymongo import MongoClient
#mongod --dbpath /home/mic/databases/
def fill_data(users_no):
for i in range(users_no):
doc = {
'_id': str(i),
'uname': "name_" + str(i),
}
sDB.insert(doc)
if __name__ == "__main__":
db = MongoClient().test
sDB = db.users
fill_data(10)
users_no = sDB.find().count()
Which of three MongoDB drivers would work best and is most efficient for above Flask template?