Skip to content

Implementing support for nested properties#20

Open
rafakato wants to merge 2 commits into
achingbrain:masterfrom
rafakato:nested-properties
Open

Implementing support for nested properties#20
rafakato wants to merge 2 commits into
achingbrain:masterfrom
rafakato:nested-properties

Conversation

@rafakato
Copy link
Copy Markdown

I've added support for declaring and attaching files in nested properties.

Defining nested fields:

schema.plugin(crate, {
    storage: storage,
    fields: {
       'nested.attachments': {}
    }
});

Attaching to nested field:

model.attach('nested.attachment', {path: '/path/to/file'})

I've added the dependency for lodash to manage get and set nested fields from string, I try to make it work with mpath that is the native from mongoose but the set method was not working as expected, it was not setting the nested property.

@coveralls
Copy link
Copy Markdown

coveralls commented Jan 24, 2017

Coverage Status

Coverage decreased (-87.2%) to 12.821% when pulling c282046 on rafakato:nested-properties into 13aa291 on achingbrain:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Jan 24, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 173d6ff on rafakato:nested-properties into 13aa291 on achingbrain:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants