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

Do not throw error if user provide a pointer like index onMongo #6923

Merged

Conversation

Moumouls
Copy link
Member

@Moumouls Moumouls commented Oct 1, 2020

Here a mini fix since an old PR of @dplewis was closed (#4629) to just allow advanced developers to create index for pointers field. I know it's not the best solution, but currently it could be an easy workaround.

@Moumouls
Copy link
Member Author

Moumouls commented Oct 1, 2020

Since lint here just add some difficulty to read here the main (little) code:
We just need to avoid throwing an error if the developer try to create a pointer like index

Object.keys(field).forEach(key => {
          if (
            !Object.prototype.hasOwnProperty.call(
              fields,
              key.indexOf('_p_') === 0 ? key.replace('_p_', '') : key
            )
          ) {

@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #6923 into master will decrease coverage by 0.04%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6923      +/-   ##
==========================================
- Coverage   93.85%   93.80%   -0.05%     
==========================================
  Files         169      169              
  Lines       12220    12220              
==========================================
- Hits        11469    11463       -6     
- Misses        751      757       +6     
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.92% <72.72%> (-0.67%) ⬇️
src/RestWrite.js 93.82% <0.00%> (-0.33%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 96.02% <0.00%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 922dc76...b379212. Read the comment docs.

@Moumouls
Copy link
Member Author

Moumouls commented Oct 1, 2020

Test case added i don't know why code cov is not happy :/

@davimacedo davimacedo merged commit 929c4e1 into parse-community:master Oct 1, 2020
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