[
https://issues.apache.org/jira/browse/COUCHDB-2988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15313093#comment-15313093
]
ASF GitHub Bot commented on COUCHDB-2988:
-----------------------------------------
GitHub user nickva opened a pull request:
https://github.com/apache/couchdb-fabric/pull/55
Add optional `fields` to change feed selectors
(This could be postponed until after 2.0 release. Issued to get comments
and review).
When using selectors with `include_docs=true` can specify an optional fields
array in the POST request JSON body.
Each element in the array can be a json field (or even a key path
specified as field1.field2...). Resulting documents will contain only the
specified document fields.
For example:
```
http://.../d1/_changes?filter=_selector&include_docs=true
{
"selector": {"z" : {"$gte" : 1} }, "fields": ["field1", "field2"]
}
```
Will first select only document with "z" value >= 1, then will return only
field1 and field2 in documents.
```{ "field1": "field1value", "field2": "field2value"}```
(This is a companion pr. Main pr is in couch repo)
Jira: COUCHDB-2988
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloudant/couchdb-fabric
couchdb-2988-fields-for-selectors
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fabric/pull/55.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #55
----
commit c47fa9518ea8fb3447e173c5e1fff5abfa7ed278
Author: Nick Vatamaniuc <[email protected]>
Date: 2016-06-02T21:16:33Z
Add optional `fields` to change feed selectors
When using selectors with `include_docs=true` can specify an optional fields
array in the POST request JSON body.
Each element in the array can be a json field (or even a key path
specified as field1.field2...). Resulting documents will contain only the
specified document fields.
For example:
```
http://.../d1/_changes?filter=_selector&include_docs=true
{
"selector": {"z" : {"$gte" : 1} }, "fields": ["field1", "field2"]
}
```
Will first select only document with "z" value >= 1, then will return only
field1 and field2 in documents.
```{ "field1": "field1value", "field2": "field2value"}```
(This is a companion pr. Main pr is in couch repo)
Jira: COUCHDB-2988
----
> Allow query selector as changes and replication filter
> ------------------------------------------------------
>
> Key: COUCHDB-2988
> URL: https://issues.apache.org/jira/browse/COUCHDB-2988
> Project: CouchDB
> Issue Type: Improvement
> Components: Database Core, Mango
> Reporter: Nick Vatamaniuc
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)