Giter Club home page Giter Club logo

Comments (5)

nlbydcg avatar nlbydcg commented on June 27, 2024

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.

adam-cowley avatar adam-cowley commented on June 27, 2024

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.

nlbydcg avatar nlbydcg commented on June 27, 2024

image

I want to implement the GET and SET methods that I call when I read and save data.
Just like Mongoose
@

from neode.

nlbydcg avatar nlbydcg commented on June 27, 2024

When I update, I define the type type type of the attribute as integer, but it doesn't work.
node.update()

from neode.

adam-cowley avatar adam-cowley commented on June 27, 2024

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)

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.