Comments (10)
Hey, thanks for the notice. I haven't installed CouchDB 2 yet, but will likely do so soon after release. Still, I'm not sure adding APIs for Mango will be a high priority for me, personally, so it would be great if you're able to contribute some code towards this goal.
from couchdb-python.
Just thought I'd chime in that without some mango support, there will be no way to perform a query without creating a view, as they've removed temporary views in favor of this new json-based query system.
from couchdb-python.
I'm new to CouchDB and this project but I'm looking at trying to add these new functions mango_query and mango_index. If I have any success I'll submit a pull request.
from couchdb-python.
A Mango query is just a POST
request to /:db/_find
containing some JSON in the body, so this shouldn't be hard to make, right?
from couchdb-python.
Honestly, this was really dead simple to monkeypatch:
_, _, data = db.resource.post_json('_find', body={"selector" : query}, headers = {'Content-Type': 'application/json'})
return data["docs"]
Almost nearly a one-liner. Anybody wanna make a PR?
from couchdb-python.
Maybe like in django:
For example:
data1 = db.find(field__eq='A', limit=50)
data2 = db.find(Q(field__eq='A')
& (Q(field1__subfield1__in=['lama', 'amal'])
| Q(field2__subfield2__regex ="foo")), limit=40, fields=['field1', 'field2'])
I have implementation of this. If it is acceptable, I can provide my implementation.
Q obj - https://github.com/pirr/alt_couch/blob/c690771f729c38ac39041d4fea981b44623a0748/_libs/vb/couch.py#L14
find method - https://github.com/pirr/alt_couch/blob/c690771f729c38ac39041d4fea981b44623a0748/_libs/vb/couch.py#L222
Sorry for my terrible english.
from couchdb-python.
I would like to add an implementation to CouchDB-Python. If you can provide one that fits into the library and has comments in English, I could probably review it.
from couchdb-python.
I added filter method (mango query) with comments:
pirr@6f051bc
from couchdb-python.
Looks pretty good, do you want to do a pull request for this?
from couchdb-python.
#324 this is my first pool reguest. If there are comments, please, I will correct
from couchdb-python.
Related Issues (20)
- couchdb-dump: No python 3.5 support HOT 1
- `ViewResult` slicing with `datetime` object HOT 3
- Missing git tag for 1.1 HOT 1
- HTTP basic auth is broken for accented characters HOT 2
- Server.version() broken for CouchDB 2.0 HOT 6
- Support CouchDB 2.0.0 HOT 10
- CouchDB 2.0 - syncing views make CouchDB hanging HOT 4
- Not url-encoding doc IDs in update handler call HOT 15
- Put Multiple Attachments HOT 1
- Bug when used with multiprocessing HOT 3
- `'_io.BytesIO' object is not subscriptable` when creating new document HOT 8
- More user friendly for HTTP Basic Auth HOT 2
- View Server Write Error: str, not bytes HOT 3
- config has moved in 2.0.0 HOT 4
- missing find() definition on Database class HOT 5
- [Mango query] Show warning when no matching index found. HOT 1
- Cant find a way to send headers in replication HOT 2
- End of Support ?= End Of Documentation HOT 2
- Cookie auth token error
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 couchdb-python.