Giter VIP home page Giter VIP logo

Comments (7)

ra0o0f avatar ra0o0f commented on May 30, 2024

@adamlubek

did you get any exception in parsing the result?

var results = db.Collection(Rule.RULES_COLLECTION_NAME).All<JObject>().ToList();
var id = results[0].Value<int>("id");

you can get the valid json in string by results[0].ToString() but it would be better for performance if you make a http request directly for the raw result to avoid serializing.

from arangoclient.net.

adamlubek avatar adamlubek commented on May 30, 2024

No, I don't get any exceptions.

when using results[0].ToString(), I get:

"{\r\n \"id\": 222,\r\n \"name\": \"'some other name'\",\r\n \"_id\": \"rules/586748548934\",\r\n \"_rev\": \"586751498054\",\r\n \"_key\": \"586748548934\"\r\n}"

which isn't valid json. Can I get raw json from db without specifying type? something like:
db.Collection(Rule.RULES_COLLECTION_NAME).All().ToList();

from arangoclient.net.

ra0o0f avatar ra0o0f commented on May 30, 2024

why its not valid? if you mean its Indented try result[0].ToString(Formatting.None)

from arangoclient.net.

adamlubek avatar adamlubek commented on May 30, 2024

this works but I had to do:

working

It works now but it's not too elegant. Can you think of any better way of doing this ra0o0f?

note that when retrieving data from DB i had to use JObject coming from ArangoDB.Client namsepace and then when returning list of JObjects I had to use Nettonsoft.Json. If I used JObject from ArangDB.Client namespace everywhere then this wouldn't work.

I'm guessing here but maybe it's a case of updating Newtonsoft.Json to latest version?

from arangoclient.net.

ra0o0f avatar ra0o0f commented on May 30, 2024

others have face his problem too, it could be solved if the client use the json.net itself instead of embeding it, i couldnt decide to remove the embeded json.net yet.

would you please tell where in your application you are consuming JObject (from json.net), that you couldnt do it with the JObject (from embeded json.net)?

from arangoclient.net.

adamlubek avatar adamlubek commented on May 30, 2024

I expose it from ApiController as HttpResponseMessage using Ok:

capture

which without work-around I pasted in 5th comment doesn't work as it returns empty keys with empty arrays.
Looks like it's a problem with version of Newtonsoft.Json that you're using in your library?

from arangoclient.net.

ra0o0f avatar ra0o0f commented on May 30, 2024

@adamlubek the embedded json.net is now removed from the client and is using it as an nuget dependency . you can install the latest version on nuget

from arangoclient.net.

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.