GithubHelp home page GithubHelp logo

Comments (13)

ArnaudValensi avatar ArnaudValensi commented on July 20, 2024 2

This is now fixed in the 2.14.5. It also solve a problem where sometime internal mongoose fields are considered as regular collection fields.

from forest-express-mongoose.

bguivarch avatar bguivarch commented on July 20, 2024 1

@arnaudbesnier I have the same error as well.
[email protected], [email protected] an [email protected]

from forest-express-mongoose.

ArnaudValensi avatar ArnaudValensi commented on July 20, 2024 1

Hi everybody, I'm on it.
The problem is with the last versions of mongoose, it seems to work with "mongoose": "5.2.16".
The problem sould be fixed soon.

from forest-express-mongoose.

roopakv avatar roopakv commented on July 20, 2024 1

Thank you so much Arnaud! ghat worked

from forest-express-mongoose.

arnaudbesnier avatar arnaudbesnier commented on July 20, 2024

Hi @roopakv, this is definitely an unexpected error.
In order to have more context and help you us identify what could happen can you provide a few more details:

  • Did you follow the setup steps as described in the documentation/onboarding pages?
  • Did you do some more actions?
  • Do you have a lot of Mongoose schemas or specific schemas with a very large/complex/deep schema?

I imagine that this exception is due to some specific schemas but we need to identify them to go deeper.
We have several way to investigate on this:

  • You can try to reduce the number of schema declared in your modelsDir to isolate the model(s) that raise the error.
  • Even simpler you can use an undocumented property includedModels that makes the agent do the introspection only on the declared models. Something like:
app.use(require('forest-express-mongoose').init({
  modelsDir: __dirname + '/models',
  envSecret: process.env.FOREST_ENV_SECRET,
  authSecret: process.env.FOREST_AUTH_SECRET,
  mongoose: require('mongoose') // The database connection.
  includedModels: ['customers', 'purchases', ...] // To replace with your own schema names
}));

should work if you mongoose schema are defined before the liana init code.

from forest-express-mongoose.

roopakv avatar roopakv commented on July 20, 2024

Sorry i was out for a couple of days.

  • Did you follow the setup steps as described in the documentation/onboarding pages?
    • Yes
  • Did you do some more actions?
    • No
  • Do you have a lot of Mongoose schemas or specific schemas with a very large/complex/deep schema?
    • Big yes

Let me look into finding the model with a problem and get back to you folks. We are working to hit a deadline so expect me to get back to you toward the end of the week.

Also is there anyway we can use lumber with mongodb? or any solution where we keep our data instead of pushing it to your servers? basically a hosted solution?

from forest-express-mongoose.

roopakv avatar roopakv commented on July 20, 2024

So I did some work around this.

-> even if I use includedModels since all models are already loaded into mongoose, the above error is thrown. It seems to be a problem in forest-express.

Is there an easy way to load model by model rather than with forest-express-mongoose

from forest-express-mongoose.

arnaudbesnier avatar arnaudbesnier commented on July 20, 2024

Hi @roopakv, As I said in my previous comment, the other way to investigate is to remove all your schema declaration files and re-add them progressively to isolate the schemas that generate such error.

from forest-express-mongoose.

saintmac avatar saintmac commented on July 20, 2024

@arnaudbesnier I've got the same error, with a dead simple setup: only 1 model with 1 Boolean field (also tested with 1 String field and got the same error).
I tested with a few recent versions of express, mongoose and this package.
Including: [email protected], [email protected] and [email protected]

from forest-express-mongoose.

ArnaudValensi avatar ArnaudValensi commented on July 20, 2024

Hi @roopakv, @saintmac, @bguivarch,
The issue is fixed in the version 2.14.2.
You can do:

npm install forest-express-mongoose@latest

or

yarn add forest-express-mongoose@latest

from forest-express-mongoose.

saintmac avatar saintmac commented on July 20, 2024

Working for me as well, thanks!

from forest-express-mongoose.

ArnaudValensi avatar ArnaudValensi commented on July 20, 2024

Sorry guys, we had to release a version 2.14.4 of forest-express-mongoose with the patch for this issue reverted. It was causing some troubles with the embedded documents.

So the recommendations for now are the following:

  • Use the version 2.14.4 with mongoose <=5.2.*
  • Use the version 2.14.2 or 2.14.3 if you really need to use the latest version of mongoose, but you may have troubles with subdocuments

I'm currently working on a definitive fix. I'll keep you posted.

from forest-express-mongoose.

roopakv avatar roopakv commented on July 20, 2024

Thank you for the update. it seems like 2.14.4 with mongoose 5.2.14 doesnt seem to work for us.

Looking forward to see what fix you have planned

from forest-express-mongoose.

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.