Questions tagged [mongokit]

MongoKit framework try to keep its simplicity when you manage mongodb in python. MongoKit was developed to be fast and light with KISS and DRY in mind. MongoKit brings structured schema and validation layer on top of the great pymongo driver.

Documentation: https://github.com/namlook/mongokit/wiki

Source at github: https://github.com/namlook/mongokit

56 questions
0
votes
1 answer

Metaclass error from Flask-MongoKit

I'm trying to assemble a basic login system using Flask, Flask-Login, and Flask-MongoKit. Here's my User class: class User(Document): __collection__ = 'users' structure = { 'username': basestring, 'password': basestring, …
futuraprime
  • 5,468
  • 7
  • 38
  • 58
0
votes
1 answer

How to pick a specific connection with mongokit?

I'm trying to connect to a Mongo DB with Django and Mongokit (using django-mongokit). When I try to feed it a remote In settings.py: DATABASES = { 'default': dj_database_url.config(default=os.environ['DATABASE_URL']), 'mongodb':…
greggilbert
  • 1,313
  • 2
  • 13
  • 26
0
votes
1 answer

How to use AND condtion in mongokit when a key has multiple values

I have a key in my document named "tag". Now this has the structure like this: "tag": [ { "schemeName": "http:\/\/somesite.com\/categoryscheme2", "name": "Test Tag2", "value": 1, "slug": "test_tag2" }, { …
Engineer
  • 5,911
  • 4
  • 31
  • 58
0
votes
1 answer

How to pass an array of conditions in mongokit find query

How can i pass array of condtions in mongokit find query. Untill now , i am implementing queries like : data = db.entry.find({'title':{'$regex':'test'},'status':{'$regex':'active'}}).limit(3); Condtions are bound to increase. Is there any way i…
Engineer
  • 5,911
  • 4
  • 31
  • 58
0
votes
3 answers

Mongokit add objects to collection

How do you insert objects to a collection in using MongoKit in Python? I understand you can specify the 'collection' field in a model and that you can create models in the db like user = db.Users() Then save the object like user.save() However I…
Mike
  • 709
  • 7
  • 19
0
votes
1 answer

How to set TTL index for collection in MongoKit?

I want to use 'Time To Live' collection feature (http://docs.mongodb.org/manual/tutorial/expire-data/) in my app (flask+mongokit). It is possible to create TTL index for all documents in collection via MongoKit when i describe my models or i need to…
user2293072
  • 766
  • 6
  • 9
0
votes
1 answer

How to update an object after find() with mongokit?

@connection.register class User(Document): __database__ = 'foo' __collection__ = 'bar' structure = { '_id' : ObjectId, 'Email' : basestring, } col = connection['uplace']['user'] user = col.find()[2] user2 =…
carboncomputed
  • 1,630
  • 3
  • 20
  • 42
0
votes
1 answer

Mongokit validate dict inside list

How can I validate that my desc field is required and my category field is optional? class Mydoc(Document): structure = { "name": unicode, "items": [{ "category": int, "desc": unicode }] } …
danielrvt
  • 10,177
  • 20
  • 80
  • 121
0
votes
1 answer

Mongodb create index with flask mongokit extension

I'm trying to create an index with a flask-mongokit connection: db = MongoKit(app) db.mydatabase.users.create_index("email", unique=True) But it throws this error at me: ... host=ctx.app.config.get('MONGODB_HOST'), AttributeError: 'NoneType' object…
danielrvt
  • 10,177
  • 20
  • 80
  • 121
0
votes
1 answer

MongoKit's callable object has no attribute 'find_and_modify'

I'm using MongoKit as ODM framework. I have object User: class User(Document): __collection__ = 'users' ... There is no __database__ here - I'm using different ones depend on current profile (development, testing etc.) I use queries like…
Marboni
  • 2,399
  • 3
  • 25
  • 42
0
votes
1 answer

Geospatial Index using MongoKit

Is there a way to create geospatial indexes over fields in a MongoKit Document? Right now I can't find any reference to do so using the indexes descriptor. I would like to have something like class Foo(Document): structure = { …
sebasmagri
  • 170
  • 2
  • 10
1 2 3
4