Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to pick schema key of type array #430

Closed
pociej opened this issue Aug 17, 2015 · 3 comments
Closed

unable to pick schema key of type array #430

pociej opened this issue Aug 17, 2015 · 3 comments

Comments

@pociej
Copy link
Contributor

pociej commented Aug 17, 2015

Schemas.TestSchema = new SimpleSchema({
  test : {
    type : String ,
  }
});

Schemas.MySchema = new SimpleSchema({
  myField : {
    type : [Schemas.TestSchema]
  }
});

then

Schemas.MySchema.pick('myField')
Error: Invalid definition for myField.$ field.

confusing...

@pociej pociej changed the title unable to pick schema array unable to pick schema key of type array Aug 17, 2015
@raptor008
Copy link

See issue #284.

Looks like I'm having luck by passing both "myField" and "myField.$". E.g.,

Schemas.MySchema.pick('myField', 'myField.$');

@jholl
Copy link

jholl commented Oct 1, 2015

This worked for me; and if anyone comes across in the future, also when I had

type: [String],

and wanted to pick it, I needed to include fieldname, fieldname.$ in my pick

@aldeed
Copy link
Collaborator

aldeed commented Nov 12, 2015

Duplicate of #284

@aldeed aldeed closed this as completed Nov 12, 2015
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

No branches or pull requests

4 participants