Skip to content

Add set function to an object #2729

Closed
Closed

Description

@robert-zaremba

Currently if we want to manipulate the object and set some of it's fields we need to deconstruct it using map or keys.

The use case is to allow writing more sophisticated function manipulation.
Eg something we could write in JS:

function (doc1, doc2) {
    doc1.inner.key = doc2.inner.key2
    return doc1
}

Proposal:

set method, which will manipulate an object:

doc1.inner.set(key, val)

Activity

  1. coffeemug commented on Jul 21, 2014

    @coffeemug
    Contributor

    Closing in favor of #2692, which supersedes this issue.

    FYI, you could currently use the merge command as follows:

    function (doc1, doc2) {
        return doc1.merge({inner: {key: docs('inner')('key')}})
    }

    This will get a lot easier once #2692 is implemented.

  2. added this to the duplicate milestone on Jul 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions