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

fix: consistency issue with getDocument on unfound doc #15

Merged
merged 1 commit into from
May 15, 2020

Conversation

Alex-Werner
Copy link
Owner

Issue being fixed or implemented

When we require a document by it's ID that do not exist, with the MemoryAdapter, the response looks like :

> getDocument('754aeea7c0919797d6eb2710d200eafd') 
{
   "_id": "754aeea7c0919797d6eb2710d200eafd"
}

While the FS adapter will return an empty object ({});.

What was done

Removed the _id field from return object of unfound document.

How Has This Been Tested?

Using current test suite.

Notes

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@Alex-Werner Alex-Werner merged commit cc3c5ec into develop May 15, 2020
@Alex-Werner Alex-Werner mentioned this pull request May 15, 2020
@Alex-Werner Alex-Werner deleted the fix/consitency-mem-adapter branch May 15, 2020 05:56
Alex-Werner added a commit that referenced this pull request Aug 29, 2020
* chore: update mongo-objectid + exposed it (#16)

* chore: updated mongo-objectid to 1.2.0

* feat: exposed ObjectID

* test: added exposition test

* chore: updated mongo-objectid to 1.2.1

* chore: bump dependencies to latest

fix security issue.

* fix: consistency issue with getDocument on unfound doc (#15)

Match fs adapter comportment

* chore(package): bump to 3.0.0

* fix: issue with lower fill factor than order for single element tree (#14)

* fix: issue with lower fill factor than order for single element tree (#13)

* fix(SBFRoot/findLowerThan): finding document on equal case for lte

Specific case when order is bigger than actual size

* style: formatting

* test: add tests for tree with lower size than order

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>

* docs: docsify

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>
Alex-Werner added a commit that referenced this pull request Aug 29, 2020
* chore: update mongo-objectid + exposed it (#16)

* chore: updated mongo-objectid to 1.2.0

* feat: exposed ObjectID

* test: added exposition test

* chore: updated mongo-objectid to 1.2.1

* chore: bump dependencies to latest

fix security issue.

* fix: consistency issue with getDocument on unfound doc (#15)

Match fs adapter comportment

* chore(package): bump to 3.0.0

* fix: issue with lower fill factor than order for single element tree (#14)

* fix: issue with lower fill factor than order for single element tree (#13)

* fix(SBFRoot/findLowerThan): finding document on equal case for lte

Specific case when order is bigger than actual size

* style: formatting

* test: add tests for tree with lower size than order

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>

* feat: add isReady method + remove waitFor deps (#18)

* feat(SBTree): add isReady method

* feat: moved waitFor to use isReady method

* fix: fslock breaking change

* docs: docsify documentation (#22)

* chore: update mongo-objectid + exposed it (#16)

* chore: updated mongo-objectid to 1.2.0

* feat: exposed ObjectID

* test: added exposition test

* chore: updated mongo-objectid to 1.2.1

* chore: bump dependencies to latest

fix security issue.

* fix: consistency issue with getDocument on unfound doc (#15)

Match fs adapter comportment

* chore(package): bump to 3.0.0

* fix: issue with lower fill factor than order for single element tree (#14)

* fix: issue with lower fill factor than order for single element tree (#13)

* fix(SBFRoot/findLowerThan): finding document on equal case for lte

Specific case when order is bigger than actual size

* style: formatting

* test: add tests for tree with lower size than order

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>

* docs: docsify

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>

* tests!: reorganize tests + nested functional

BREAKING: get document unfound returns null instead of {}

* chore: added DS and nyc output to ignored entities

* chore!: return single document as [] + split lodash module

* chore: update dev deps

* style: eslint fix

* fix:  handling on unfound field

* feat!: remove single object as array

* chore: add badges

Co-authored-by: Anurag Vohra <53807480+anuragvohraec@users.noreply.github.com>
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.

None yet

1 participant