Git Product home page Git Product logo

Comments (6)

vadimdemedes avatar vadimdemedes commented on July 20, 2024

Hello, thank you for the kind words, it means a lot to me!

Sorry for much delayed response, I've been very busy lately. This certainly looks like a must-have feature for Mongorito, so let me investigate a bit about what I can do and get back to you with a solution.

Thank you for suggestion!

from mongorito.

maxfrigge avatar maxfrigge commented on July 20, 2024

One thing that came to my mind when I read this is to add a getter Model.raw which gives direct access to the mongo collection (e. g. db.cities). This way you would get the full power of mongo without adding too many complex features to the ORM.

let cities = City.raw.find({ '$text': { '$search': 'San Francisco' } }, {'score': {'$meta': 'textScore'}}) .sort({'score': {'$meta': 'textScore'}})

I have seen this in other lightweight ORMs before and always found it to be very handy.

from mongorito.

vadimdemedes avatar vadimdemedes commented on July 20, 2024

@maxfrigge possible solution, but it would prevent me to migrate underlying libraries to talk to mongodb. I had an idea to migrate from monk to mongodb-core to increase performance. But with this solution, I wouldn't be able to do that without breaking people's apps.

from mongorito.

maxfrigge avatar maxfrigge commented on July 20, 2024

@vdemedes good point. In that case it's probably best to settle for a mongo lib first before adding any access to the underlying system (if at all).

So what would be your take on using a feature that's not supported by mongorito?
Use e.g. monk alongside with mongorito?

from mongorito.

vadimdemedes avatar vadimdemedes commented on July 20, 2024

@maxfrigge That is, of course, a solution but a very bad one. I'll see what I can do. Unfortunately, I am very busy this and the following week, so I can't guarantee a quick fix.

from mongorito.

vadimdemedes avatar vadimdemedes commented on July 20, 2024

@Adrianca @maxfrigge Pushed [email protected], which fixes current issue. Example:

let posts = yield* Post.search('San Francisco').sort('score', {
  '$meta': 'textScore'
}).include('score', {
  '$meta': 'textScore'
}).find();

Thank you for submitting the issue and participating!

from mongorito.

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.