Coder Social home page Coder Social logo

Comments (23)

simonecogno avatar simonecogno commented on June 7, 2024 1

+1 I have loose 4 hours to find what was the performance problem of my query

from loopback-connector-mongodb.

HugoPoi avatar HugoPoi commented on June 7, 2024 1

UP This issue is still relevant for 1.18.x and 3.x.

See
https://github.com/strongloop/loopback-connector-mongodb/blob/c0c75f915ea54079e66c819e28036b7c7bf6f7d6/lib/mongodb.js#L729-L734
And
https://github.com/strongloop/loopback-connector-mongodb/blob/0041f217019c84983ba3eec39c0ac993807289fc/lib/mongodb.js#L849-L854

@kjdelisle Can we re-open and merge #177 ?

from loopback-connector-mongodb.

HugoPoi avatar HugoPoi commented on June 7, 2024 1

@dhmlau @jannyHou I open PR #437 based on your suggestion and inspired by #177

from loopback-connector-mongodb.

raymondfeng avatar raymondfeng commented on June 7, 2024

Maybe we can make it controllable via a model/method level configuration property.

from loopback-connector-mongodb.

mazesoul avatar mazesoul commented on June 7, 2024

+1

from loopback-connector-mongodb.

Ijmir avatar Ijmir commented on June 7, 2024

+1

from loopback-connector-mongodb.

thaiat avatar thaiat commented on June 7, 2024

+1

from loopback-connector-mongodb.

SynerG avatar SynerG commented on June 7, 2024

+1 Please, fix this. Even if you create a specific index for your query, MongoDb cannot use the index because Loopback requests to order by _id, and the field is not included in the index. MongoDB docs explain it: https://docs.mongodb.org/manual/core/index-intersection/#index-intersection-and-sort

from loopback-connector-mongodb.

sebastianhaas avatar sebastianhaas commented on June 7, 2024

+1

from loopback-connector-mongodb.

0101adm avatar 0101adm commented on June 7, 2024

+1

from loopback-connector-mongodb.

bidos avatar bidos commented on June 7, 2024

+1

from loopback-connector-mongodb.

stale avatar stale commented on June 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from loopback-connector-mongodb.

sebastianhaas avatar sebastianhaas commented on June 7, 2024

This is still relevant to me!

from loopback-connector-mongodb.

stale avatar stale commented on June 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from loopback-connector-mongodb.

sebastianhaas avatar sebastianhaas commented on June 7, 2024

Don't!

from loopback-connector-mongodb.

HugoPoi avatar HugoPoi commented on June 7, 2024

I loose one day because of this default sort operation on "_id". THE DEFAULT BEHAVIOR FOR MONGODB MUST BE NO SORT when no sort operation is specify !
Please merge #177 !

from loopback-connector-mongodb.

stale avatar stale commented on June 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from loopback-connector-mongodb.

sebastianhaas avatar sebastianhaas commented on June 7, 2024

Don't

from loopback-connector-mongodb.

dhmlau avatar dhmlau commented on June 7, 2024

@strongloop/lb-next-dev , seems like this is a popular feature request, and a related PR ready (#177). Want to initiate the discussion on how we're going to tackle it?

from loopback-connector-mongodb.

jannyHou avatar jannyHou commented on June 7, 2024

I think we can continue the discussion based on @raymondfeng 's suggestion in #177

Two thoughts around the proposal:
    - Should we provide a configuration option at app/model level to control if order by id should be enforced?
    - We should support the same option for all connectors.

A global flag(app/model level) sounds good to me, considering one app can have multiple datasources/models, we can start with enabling the model level config.
And we can change this line in #177 to read the flag from modelDefinition.settings

Anyone interested to create a PR to continue the work in #177 ? I can help review and land it.

from loopback-connector-mongodb.

stale avatar stale commented on June 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from loopback-connector-mongodb.

dhmlau avatar dhmlau commented on June 7, 2024

In evaluation whether we can work on it for July milestone

from loopback-connector-mongodb.

jannyHou avatar jannyHou commented on June 7, 2024

Should be fixed by #437, i am closing this issue.
Feel free to reopen it if you still have the problem.

from loopback-connector-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.