سؤال

How it's possible to execute command convertToCapped with pymongo or, probably, native mongodb driver for python if it's not possible to do that with pymongo.

هل كانت مفيدة؟

المحلول

Use the command method of the database object:

mongo = pymongo.MongoClient()
mongo.DBNAME.command('convertToCapped', 'COLLNAME', size=SIZE)

MongoDB's convertToCapped

pymongo's command

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top