Comments (5)
I have revised your file.
Enabling NPM packages to support GET and SET
I'm not sure if you will add this method.
I put the code on my GitHub first, because my colleague also needs to use this NPM package, so I have to put it on gitHub.
If you mind, I'll delete this NPM package on my gitHub
from neode.
What are you trying to do?
There is an update method on nodes and relationships to set properties.
const node = neode.find('User', 1);
node.update({ property: 'value' });
In terms of serialising to JSON, you can call toJson
on a node or a collection of nodes which will turn the properties and any eager attributes into JSON. Something like this:
neode.all('Movie', params, order , limit, skip)
.then(res => {
/*
*`all` returns a NodeCollection - this has a toJson method that
* will convert all Nodes within the collection into a JSON object
*/
return res.toJson();
})
.then(json => {
res.send(json);
})
https://github.com/adam-cowley/neode-example/blob/master/routes/api.js#L34
Feel free to keep your forked repo. Any PR's are welcome if there are any bugs or features you think are missing.
from neode.
I want to implement the GET and SET methods that I call when I read and save data.
Just like Mongoose
@
from neode.
When I update, I define the type type type of the attribute as integer, but it doesn't work.
node.update()
from neode.
I like this idea. I will see if I can find some time to implement it. If you need it imminently, feel free to submit a PR.
from neode.
Related Issues (20)
- @hapi/joi is outdated! PLease replace with joi HOT 1
- Error in type definition HOT 1
- Model.update will update fields which are not defined in the schema. HOT 1
- Error when indexed is set to true: Not sure how to validate indexed on name HOT 6
- TypeError: metatype is not a constructor - Neode DynamicModule with model NestJs HOT 1
- Is there a way to eagerly load multiple nodes with a given relationship type? HOT 3
- errorMessage: Converting circular structure to JSON
- Model support for array type HOT 1
- Support for parentheses in where conditions
- Does Neode.create<T>(...) async? HOT 8
- Validation Documentation Is Vague HOT 2
- Can I add extra labels to nodes when CREATE or MERGE with query builder?
- Validation error when creating node
- Disallow additional fields?
- No transactions? HOT 1
- AN ERROR OCCURRED WHILE EXECUTING SEARCH: Writing in read access mode not allowed. Attempted write to internal graph 0 (neo4j) HOT 2
- Node Validation on Schema Update
- Examples of node as a Property Type?
- Argument of type 'string' is not assignable to parameter of type 'Model<unknown>'
- Session Expired on Query HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neode.