Comments (2)
Note: this only applies to the latest git version (the latest stable from pypi doesn't have this yet).
The new version in git (since 5e50210 ) does allow you to pass _is_command argument there.
I also had this issue and needed to run distincts and counts. I'm using the new Client.command function though (you could continue doing it your way using db['$cmd'] or use what I've got):
command = {
'distinct': 'collectionname',
'key': 'distinctkey',
'query': query_spec,
}
self.db.command(command, callback=callback)
and
command = {
'count': 'collectionname',
'query': query_spec,
}
self.db.command(command, callback=callback)
It'd be nifty if stub helpers were attached to the Cursor class so that everything is available there (so we do cursor.save(), cursor.update(), cursor.distinct(), cursor.count() etc.)
from asyncmongo.
I'm using the latest git version of asyncmongo (0.1.3) and I'm having issues with using the new db.command syntax.
When I try
command = SON()
command['findandmodify'] = 'seq'
command['query'] = { '_id' : "myids" }
command['update'] = { '$inc': { 'seq': long(1) } }
command['new'] = True
command['upsert'] = True
db.command(command, callback=callback)
I get a TypeError saying: 'Cursor' object is not callable.
But if I do
command = SON()
command['findandmodify'] = 'seq'
command['query'] = { '_id' : "myids" }
command['update'] = { '$inc': { 'seq': long(1) } }
command['new'] = True
command['upsert'] = True
db["$cmd"].find_one(command, _is_command=True, callback=callback)
It works out fine. Any ideas about what's going wrong?
from asyncmongo.
Related Issues (20)
- Support for server-side scripting
- support other async libraries HOT 1
- The delay in the request for a large database on 64bit
- thread safety HOT 1
- README.md not included with package, results in setuptools error HOT 1
- Using the compiled bson library results in errors with Binary data HOT 3
- Connections not getting released or reused HOT 4
- get list of all collections HOT 2
- block request when reach the maxConnections HOT 3
- Client().insert() not return ObjectId() HOT 3
- Python 3.x support HOT 1
- Add support for group & aggregates
- Logical Operators: HOT 6
- examples
- when Tornado autoreload, asyncmongo didn't release connections
- Support for tornado > 3.0? HOT 2
- Upload to PyPI HOT 2
- Support for {'$meta': 'textScore'} in sort for mongo 2.6
- helpers.py _unpack_response error
- No module named 'errors'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncmongo.