Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Changed code to accommodate MongoDB's ObjectID #2

Merged
merged 3 commits into from
Jan 31, 2018
Merged

Conversation

eddyystop
Copy link
Member

  • convert-args-to-feathers now uses lodash.mergewith instead of deepmerge,
    as mergewith retains 'instance of ObjectID' for ObjectID objects.
  • lodash.merge may have been sufficient as the customizer for mergewith
    is no-op'ed. It however has code to explicitly reconstruct an ObjectID
    object. This may be needed based on test results, and it can be
    expanded for other similar situations.
  • convert-args-to-parms converts prop names starting with __ to ones starting
    with $, e.g. __sort to $sort. The previous code lost 'instance of ObjectID'
    for ObjectID objects. The new code does not, though it takes longer to execute.

- convert-args-to-feathers now uses lodash.mergewith instead of deepmerge,
  as mergewith retains 'instance of ObjectID' for ObjectID objects.
- lodash.merge may have been sufficient as the customizer for mergewith
  is no-op'ed. It however has code to explicitly reconstruct an ObjectID
  object. This may be needed based on test results, and it can be
  expanded for other similar situations.
- convert-args-to-parms converts prop names starting with __ to ones starting
  with $, e.g. __sort to $sort. The previous code lost 'instance of ObjectID'
  for ObjectID objects. The new code does not, though it takes longer to execute.
- GraphQL's args param to resolves does not inherit from Object and neither
  do inner objects. Neither do nested objects within args.
- lodash.mergewith faithly copies objects from args so they don't inherit
  from Object.
- NeDB is one database which requires its args to inherit from Object. Some
  parts of Feathers do likelwise.
- This commit converts args abd nested objects to inherit from Object.
@eddyystop eddyystop merged commit 8824ea6 into master Jan 31, 2018
@eddyystop eddyystop deleted the objectid-01 branch January 2, 2019 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant