Open taylor009 opened 4 years ago
I also had this question. Some things would probably have to be ignored like these dynamic requires:
const neode = require('neode')
.fromEnv()
.with({
Movie: require('./models/Movie'),
full model validation would be great, but pretty hard. prisma does this well. You could also look at typegoose which tries to infer types with Mongoose.
Yeah this raises some interesting questions on how this library would be used or could be improved to be more class/decorator oriented like prisma/typegoose. I'm trying to work out whether this is a shift in node/typescript development or whether it should become a separate library. I'd love to hear everyone's thoughts?
@adam-cowley I saw your comment I made inside the TypeORM repo about adding the support for neo4j. Might be challenging to replicating fully but I think as the node community shifts more into typescript having the class/decorator demand will increase. I'm not sure how difficult it would be to convert the existing library.
But if we need to split it out I'm willing to dedicate some time to it if needed.
I've started experimenting over here - it's basic at the moment but there are a few lines in the README and a couple of tests. It's quite far removed from neode as it stands at the moment so I may have to think how they might fit together.
https://github.com/adam-cowley/neode-ogm
I'm torn between wanting things to be properly coded (objects, etc) or whether I'd just want something that just works with minimal code/effort. But then if we're creating model files, it's only a few lines more to turn it into a class with annotations.
do you know this driver? how does it compare? https://drivine.org/
Drivine looks handy for transaction management but it still requires that you write your own queries - something that I'd personally like to avoid if possible by defining the model meta data and let the library take care of writing the queries. Jasper makes some good points under the Object Mapping:
header on the homepage.
I've put together a basic example with the typescript repo at https://github.com/adam-cowley/neode-ogm-test
All feedback welcome...
@adam-cowley I was wondering if there were some typescript examples or if neode can be used with typescript yet? If there isn't any I could help out on that.