Questions tagged [umongo]

μMongo is a Python MongoDB ODM

Resources:

  1. github
  2. pypi.python.org
  3. documentation
10 questions
2
votes
1 answer

How to separate umongo's object document models from the main web app or how to avoid calling @instance.register where document models are defined?

While creating a web app using Flask or FastAPI, there would be a main.py file that basically instantiates and runs everything. I think that is also the right place for the database connections and initialization. So ideally I'd like to have a…
jar
  • 2,646
  • 1
  • 22
  • 47
2
votes
2 answers

Using Motor with uMongo :: Always Getting None

I'm trying to figure out how to use uMongo with Monitor and I am having a problem. I can't get the uMongo document object to return anything other than None and I am sure it's something obvious I just keep overlooking. If anyone has any suggestions…
1
vote
1 answer

Python: uMongo sort

I am using uMongo with Python 3.0 I have this model: class Job(Document): priority = IntField() I'm using: jobs = Job.find() To get all jobs from mongo instance, and I am trying to sort them by priority.. but unfortunely, I can't seem to find…
ET-CS
  • 6,334
  • 5
  • 43
  • 73
0
votes
1 answer

Bulk insert/update with umongo

I would like to perform bulk insert/update with the umongo library in Python. Is there a way to do the bulk update all at once or am I going to run one insert/update job per item to update ?
Robin Nicole
  • 113
  • 2
  • 8
0
votes
1 answer

umongo, pymongo, python 3, how do i load data from reference field(s)

I'm trying to understand how and why it's so hard to load my referenced data, in unmongo/pymongo @instance.register class MyEntity(Document): account = fields.ReferenceField('Account', required=True) date = fields.DateTimeField( …
baku
  • 765
  • 8
  • 22
0
votes
1 answer

Python 3, ODM (umongo), difficulty with relationship fields

I'm having some trouble getting relationships fields to work in umongo. Each Document definition is in a separate file. In this example i have two basic entities, account and target. each target has a reference to an account. //…
baku
  • 765
  • 8
  • 22
0
votes
1 answer

uMongo get random document from collection

I'm currently learning MongoDb and creating an app on python. I need to select one random document from user collection using uMongo, I have tried aggregate but it says that umongo have no this function. How can i do that?
0
votes
2 answers

Can't get list of model fields

I need to get list of model fields like: @instance.register class Todo(Document): title = fields.StringField(required=True, default='Name') description = fields.StringField() created_at = fields.DateTimeField() created_by =…
Skufler
  • 187
  • 1
  • 4
  • 14
0
votes
1 answer

How to serialize umongo documents

Let's say I have the following example: from datetime import datetime import dill from pymongo import MongoClient from umongo import Instance, Document, fields, validate db = MongoClient().test instance = Instance(db) @instance.register class…
Anton
  • 1,314
  • 1
  • 12
  • 27
0
votes
1 answer

Is any application for MongoDB browser in ubuntu 16.04 32 bit processor

I trying to install Mongo DB browser for Ubuntu 16.04 32 bit version but none of application installing to the machine
Harishbn
  • 97
  • 9