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

Deprecate bypassSchema param, introduce updateOptions #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhunjadi
Copy link

As reported in #15, bypassSchema parameter is not working.

I've taken here a different approach, you can now pass updateOptions object to cache config.

Instead of

Posts.cache({
  type:'one',
  collection:Meteor.users,
  fields:['username', 'profile.firstName', 'profile.lastName'],
  referenceField:'author_id',
  cacheField:'author',
  bypassSchema: true
})

we have

Posts.cache({
  type:'one',
  collection:Meteor.users,
  fields:['username', 'profile.firstName', 'profile.lastName'],
  referenceField:'author_id',
  cacheField:'author',
  updateOptions: {
    bypassCollection2: true
  }
})

which works as expected.

Other updates:

  • cacheField transform can now return undefined without crashing, because Meteor changed the way undefined fields are handled in insert/update/find. See the docs
  • bumped lodash version to 4.17.15
  • updated testing - for easier testing of updateOptions which requires both aldeed:collection2 and simpl-schema packages

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.

1 participant