Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-2988

Allow query selector as changes and replication filter

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Database Core, Mango
    • Labels:
      None

      Issue Links

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user nickva opened a pull request:

        https://github.com/apache/couchdb-couch/pull/162

        Implement Mango selectors for change feeds

        API is modeled after _doc_ids filter for change feeds.

        User POSTs to

        {db}/_changes with `filter=_selector`.
        Document body should have a "selector" field, with
        a Mango selector object as value.

        For example:
        ```
        http://.../d1/_changes?filter=_selector
        {
        "selector": {"z" : {"$gte" : 1} }
        }
        ```
        In case "selector" is missing or its value is not a
        JSON object, a 400 error is returned with a
        corresponding error message. For example:
        ```
        { "error": "bad_request", "reason": "Selector error: 42, expected an object" }
        ```

        In case "selector" object cannot be validated as a
        Mango selector, a 400 error is returned with a validation
        error as "reason".

        Jira: COUCHDB-2988

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/cloudant/couchdb-couch couchdb-2988

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb-couch/pull/162.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 #162

        ----
        commit a703360b140ec610f65187818016522033709188
        Author: Nick Vatamaniuc <vatamane@gmail.com>
        Date: 2016-04-14T21:29:00Z

        Implement Mango selectors for change feeds

        API is modeled after _doc_ids filter for change feeds.

        User POSTs to {db}

        /_changes with `filter=_selector`.
        Document body should have a "selector" field, with
        a Mango selector object as value.

        For example:
        ```
        http http://.../d1/_changes?filter=_selector
        {
        "selector": {"z" :

        {"$gte" : 1}

        }
        }

        In case "selector" is missing or its value is not a
        JSON object, a 400 error is returned with a
        corresponding error message. For example:
        ```

        { "error": "bad_request", "reason": "Selector error: 42, expected an object" }

        ```

        In case "selector" object cannot be validated as a
        Mango selector, a 400 error is returned with a validation
        error as "reason".

        Jira: COUCHDB-2988


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb-couch/pull/162 Implement Mango selectors for change feeds API is modeled after _doc_ids filter for change feeds. User POSTs to {db}/_changes with `filter=_selector`. Document body should have a "selector" field, with a Mango selector object as value. For example: ``` http://.../d1/_changes?filter=_selector { "selector": {"z" : {"$gte" : 1} } } ``` In case "selector" is missing or its value is not a JSON object, a 400 error is returned with a corresponding error message. For example: ``` { "error": "bad_request", "reason": "Selector error: 42, expected an object" } ``` In case "selector" object cannot be validated as a Mango selector, a 400 error is returned with a validation error as "reason". Jira: COUCHDB-2988 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-couch couchdb-2988 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-couch/pull/162.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 #162 ---- commit a703360b140ec610f65187818016522033709188 Author: Nick Vatamaniuc <vatamane@gmail.com> Date: 2016-04-14T21:29:00Z Implement Mango selectors for change feeds API is modeled after _doc_ids filter for change feeds. User POSTs to {db} /_changes with `filter=_selector`. Document body should have a "selector" field, with a Mango selector object as value. For example: ``` http http://.../d1/_changes?filter=_selector { "selector": {"z" : {"$gte" : 1} } } In case "selector" is missing or its value is not a JSON object, a 400 error is returned with a corresponding error message. For example: ``` { "error": "bad_request", "reason": "Selector error: 42, expected an object" } ``` In case "selector" object cannot be validated as a Mango selector, a 400 error is returned with a validation error as "reason". Jira: COUCHDB-2988
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit e63f6864891ac9f00373ec0d3d5fee0085d2e2fa in couchdb-couch's branch refs/heads/master from kzx
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=e63f686 ]

        Implement Mango selectors for change feeds

        API is modeled after _doc_ids filter for change feeds.

        User POSTs to

        {db}

        /_changes with `filter=_selector`.
        Document body should have a "selector" field, with
        a Mango selector object as value.

        For example:
        ```
        http http://.../d1/_changes?filter=_selector
        {
        "selector": {"z" :

        {"$gte" : 1}

        }
        }
        ```

        Jira: COUCHDB-2988

        Show
        jira-bot ASF subversion and git services added a comment - Commit e63f6864891ac9f00373ec0d3d5fee0085d2e2fa in couchdb-couch's branch refs/heads/master from kzx [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=e63f686 ] Implement Mango selectors for change feeds API is modeled after _doc_ids filter for change feeds. User POSTs to {db} /_changes with `filter=_selector`. Document body should have a "selector" field, with a Mango selector object as value. For example: ``` http http://.../d1/_changes?filter=_selector { "selector": {"z" : {"$gte" : 1} } } ``` Jira: COUCHDB-2988
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/couchdb-couch/pull/162

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-couch/pull/162
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user nickva opened a pull request:

        https://github.com/apache/couchdb-couch-replicator/pull/36

        Implement Mango selectors for replication

        Replication document should have a "selector"
        field with a Mango selector JSON object
        as the value.

        Example:
        ```
        {
        "_id": "r",
        "continuous": true,
        "selector": {
        "_id":

        { "$gte": "d2" }

        },
        "source": "http://adm:pass@localhost:15984/a",
        "target": "http://adm:pass@localhost:15984/b"
        }
        ```

        This feature underneath uses the _changes feed
        Mango selectors capability.

        Replicator docs js validation function has been
        updated to return an error if it notices user has
        specified both `doc_ids` and `selector`. Or
        they specified `filter` and either of the other
        two.

        Replication options parsing also checks for those
        mutually exclusive fields, as replications can be
        started from the `_replicate` endpoint not just
        via the docs in `*_replicator` dbs.

        When generating a replication id, Mango selector
        object is normalized and sorted (JSON fields
        are sorted inside objects only). That is done in order
        to reduce the chance of creating two different
        replication checkpoints for same Mango selector.

        Jira: COUCHDB-2988

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/cloudant/couchdb-couch-replicator couchdb-2988

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb-couch-replicator/pull/36.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 #36


        commit 46be859d8b6f7638ce67130878a3bb5c1a1644b4
        Author: Nick Vatamaniuc <vatamane@gmail.com>
        Date: 2016-04-15T22:04:17Z

        Implement Mango selectors for replication

        Replication document should have a "selector"
        field with a Mango selector JSON object
        as the value.

        Example:
        ```
        {
        "_id": "r",
        "continuous": true,
        "selector": {
        "_id":

        { "$gte": "d2" }

        },
        "source": "http://adm:pass@localhost:15984/a",
        "target": "http://adm:pass@localhost:15984/b"
        }
        ```

        This feature underneath uses the _changes feed
        Mango selectors capability.

        Replicator docs js validation function has been
        updated to return an error if it notices user has
        specified both `doc_ids` and `selector`. Or
        they specified `filter` and either of the other
        two.

        Replication options parsing also checks for those
        mutually exclusive fields, as replications can be
        started from the `_replicate` endpoint not just
        via the docs in `*_replicator` dbs.

        When generating a replication id, Mango selector
        object is normalized and sorted (JSON fields
        are sorted inside objects only). That is done in order
        to reduce the chance of creating two different
        replication checkpoints for same Mango selector.

        Jira: COUCHDB-2988


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb-couch-replicator/pull/36 Implement Mango selectors for replication Replication document should have a "selector" field with a Mango selector JSON object as the value. Example: ``` { "_id": "r", "continuous": true, "selector": { "_id": { "$gte": "d2" } }, "source": "http://adm:pass@localhost:15984/a", "target": "http://adm:pass@localhost:15984/b" } ``` This feature underneath uses the _changes feed Mango selectors capability. Replicator docs js validation function has been updated to return an error if it notices user has specified both `doc_ids` and `selector`. Or they specified `filter` and either of the other two. Replication options parsing also checks for those mutually exclusive fields, as replications can be started from the `_replicate` endpoint not just via the docs in `*_replicator` dbs. When generating a replication id, Mango selector object is normalized and sorted (JSON fields are sorted inside objects only). That is done in order to reduce the chance of creating two different replication checkpoints for same Mango selector. Jira: COUCHDB-2988 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-couch-replicator couchdb-2988 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-couch-replicator/pull/36.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 #36 commit 46be859d8b6f7638ce67130878a3bb5c1a1644b4 Author: Nick Vatamaniuc <vatamane@gmail.com> Date: 2016-04-15T22:04:17Z Implement Mango selectors for replication Replication document should have a "selector" field with a Mango selector JSON object as the value. Example: ``` { "_id": "r", "continuous": true, "selector": { "_id": { "$gte": "d2" } }, "source": "http://adm:pass@localhost:15984/a", "target": "http://adm:pass@localhost:15984/b" } ``` This feature underneath uses the _changes feed Mango selectors capability. Replicator docs js validation function has been updated to return an error if it notices user has specified both `doc_ids` and `selector`. Or they specified `filter` and either of the other two. Replication options parsing also checks for those mutually exclusive fields, as replications can be started from the `_replicate` endpoint not just via the docs in `*_replicator` dbs. When generating a replication id, Mango selector object is normalized and sorted (JSON fields are sorted inside objects only). That is done in order to reduce the chance of creating two different replication checkpoints for same Mango selector. Jira: COUCHDB-2988
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user nickva opened a pull request:

        https://github.com/apache/couchdb/pull/405

        [deps] couch=bf9cd2b1c36909b41fc3db40f4a2c351e2e43182

        Jira: COUCHDB-2988 (Mango Selectors for _changes feeds).

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/cloudant/couchdb couchdb-2988

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb/pull/405.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 #405


        commit 814109829f540d61e3eba906cc51cb5e8bb9cea9
        Author: Nick Vatamaniuc <vatamane@gmail.com>
        Date: 2016-04-18T13:19:43Z

        [deps] couch=bf9cd2b1c36909b41fc3db40f4a2c351e2e43182

        Jira: COUCHDB-2988 (Mango Selectors for _changes feeds).


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb/pull/405 [deps] couch=bf9cd2b1c36909b41fc3db40f4a2c351e2e43182 Jira: COUCHDB-2988 (Mango Selectors for _changes feeds). You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb couchdb-2988 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb/pull/405.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 #405 commit 814109829f540d61e3eba906cc51cb5e8bb9cea9 Author: Nick Vatamaniuc <vatamane@gmail.com> Date: 2016-04-18T13:19:43Z [deps] couch=bf9cd2b1c36909b41fc3db40f4a2c351e2e43182 Jira: COUCHDB-2988 (Mango Selectors for _changes feeds).
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user kxepal commented on the pull request:

        https://github.com/apache/couchdb/pull/405#issuecomment-211376662

        May be a more human friendly commit message? Just:
        ```
        Mango Selectors for _changes feeds

        COUCHDB-2988
        ```

        Show
        githubbot ASF GitHub Bot added a comment - Github user kxepal commented on the pull request: https://github.com/apache/couchdb/pull/405#issuecomment-211376662 May be a more human friendly commit message? Just: ``` Mango Selectors for _changes feeds COUCHDB-2988 ```
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 76e9510c4cb0ebd653e0a6c3f996bf43aa4a2b77 in couchdb's branch refs/heads/master from kzx
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=76e9510 ]

        Mango Selectors for _changes feeds

        Jira: COUCHDB-2988

        Show
        jira-bot ASF subversion and git services added a comment - Commit 76e9510c4cb0ebd653e0a6c3f996bf43aa4a2b77 in couchdb's branch refs/heads/master from kzx [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=76e9510 ] Mango Selectors for _changes feeds Jira: COUCHDB-2988
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/couchdb/pull/405

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb/pull/405
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 986549984be44c7e5cd66f3773d2bdd94f506e5c in couchdb-couch-replicator's branch refs/heads/master from kzx
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch-replicator.git;h=9865499 ]

        Implement Mango selectors for replication

        Replication document should have a "selector"
        field with a Mango selector JSON object
        as the value.

        For example:
        ```
        {
        "_id": "r",
        "continuous": true,
        "selector": {
        "_id":

        { "$gte": "d2" }

        },
        "source": "http://adm:pass@localhost:15984/a",
        "target": "http://adm:pass@localhost:15984/b"
        }
        ```

        This feature underneath uses the _changes feed
        Mango selectors capability.

        Replicator docs js validation function has been
        updated to return an error if it notices user has
        specified both `doc_ids` and `selector`. Or
        they specified `filter` and either of the other
        two.

        Replication options parsing also checks for those
        mutually exclusive fields, as replications can be
        started from the `_replicate` endpoint not just
        via the docs in `*_replicator` dbs.

        When generating a replication id, Mango selector
        object is normalized and sorted (JSON fields
        are sorted inside objects only). That is done in order
        to reduce the chance of creating two different
        replication checkpoints for same Mango selector.

        Jira: COUCHDB-2988

        Show
        jira-bot ASF subversion and git services added a comment - Commit 986549984be44c7e5cd66f3773d2bdd94f506e5c in couchdb-couch-replicator's branch refs/heads/master from kzx [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch-replicator.git;h=9865499 ] Implement Mango selectors for replication Replication document should have a "selector" field with a Mango selector JSON object as the value. For example: ``` { "_id": "r", "continuous": true, "selector": { "_id": { "$gte": "d2" } }, "source": "http://adm:pass@localhost:15984/a", "target": "http://adm:pass@localhost:15984/b" } ``` This feature underneath uses the _changes feed Mango selectors capability. Replicator docs js validation function has been updated to return an error if it notices user has specified both `doc_ids` and `selector`. Or they specified `filter` and either of the other two. Replication options parsing also checks for those mutually exclusive fields, as replications can be started from the `_replicate` endpoint not just via the docs in `*_replicator` dbs. When generating a replication id, Mango selector object is normalized and sorted (JSON fields are sorted inside objects only). That is done in order to reduce the chance of creating two different replication checkpoints for same Mango selector. Jira: COUCHDB-2988
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/couchdb-couch-replicator/pull/36

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-couch-replicator/pull/36
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user nickva opened a pull request:

        https://github.com/apache/couchdb-couch/pull/177

        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 requires a companion pr in fabric to work)

        Jira: COUCHDB-2988

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/cloudant/couchdb-couch couchdb-2988-fields-for-selectors

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/couchdb-couch/pull/177.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 #177


        commit 31810005bdf9f068bc2fbef4a28a8bdace9406b1
        Author: Nick Vatamaniuc <vatamane@gmail.com>
        Date: 2016-06-02T21:04:17Z

        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 requires a companion pr in fabric to work)

        Jira: COUCHDB-2988


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb-couch/pull/177 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 requires a companion pr in fabric to work) Jira: COUCHDB-2988 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-couch couchdb-2988-fields-for-selectors Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-couch/pull/177.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 #177 commit 31810005bdf9f068bc2fbef4a28a8bdace9406b1 Author: Nick Vatamaniuc <vatamane@gmail.com> Date: 2016-06-02T21:04:17Z 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 requires a companion pr in fabric to work) Jira: COUCHDB-2988
        Hide
        githubbot ASF GitHub Bot added a comment -

        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 <vatamane@gmail.com>
        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


        Show
        githubbot ASF GitHub Bot added a comment - 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 <vatamane@gmail.com> 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
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit b4cd6709e98ad3034f482b7c266e4533cce4b891 in couchdb-couch's branch refs/heads/master from Nick Vatamaniuc
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=b4cd670 ]

        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 requires a companion pr in fabric to work)

        Jira: COUCHDB-2988

        Show
        jira-bot ASF subversion and git services added a comment - Commit b4cd6709e98ad3034f482b7c266e4533cce4b891 in couchdb-couch's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb-couch.git;h=b4cd670 ] 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 requires a companion pr in fabric to work) Jira: COUCHDB-2988
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 7cfabb5543de52639d226f509897e9b418327fcb in couchdb-fabric's branch refs/heads/master from Nick Vatamaniuc
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=7cfabb5 ]

        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

        Show
        jira-bot ASF subversion and git services added a comment - Commit 7cfabb5543de52639d226f509897e9b418327fcb in couchdb-fabric's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb-fabric.git;h=7cfabb5 ] 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
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/couchdb-couch/pull/177

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-couch/pull/177
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/couchdb-fabric/pull/55

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-fabric/pull/55
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit e828b70ba770cd695c8a51c9e1f3e6ae3edcd004 in couchdb's branch refs/heads/master from Nick Vatamaniuc
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=e828b70 ]

        Bump fabric and couch to add "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"]
        }

        COUCHDB-2988

        Show
        jira-bot ASF subversion and git services added a comment - Commit e828b70ba770cd695c8a51c9e1f3e6ae3edcd004 in couchdb's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=e828b70 ] Bump fabric and couch to add "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"] } COUCHDB-2988

          People

          • Assignee:
            Unassigned
            Reporter:
            vatamane Nick Vatamaniuc
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development