Comments (7)
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.
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.
why its not valid? if you mean its Indented try result[0].ToString(Formatting.None)
from arangoclient.net.
this works but I had to do:
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.
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.
I expose it from ApiController as HttpResponseMessage using Ok:
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.
@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)
- ArangoServerException not throw when db unavailable HOT 2
- Thread safety HOT 7
- Confused with SystemDatabaseCredential HOT 5
- Custom Index HOT 6
- ByExampleAsync missing HOT 2
- Make ChangeCollectionPropertyForType public HOT 1
- Using LINQ query with Where performance HOT 1
- Error in generated AQL when upserting a generic document HOT 7
- ArangoServerException eats up all the useful information like status code and error number HOT 2
- Make collection name resolver more extensible HOT 2
- Annotating a property of type Guid as DocumentProperty.Key throws InvalidCastException HOT 2
- Support private setter
- CreateStatement<object> & Remove Vertex HOT 1
- Ternary operator support
- Global error handling policy
- Support for keyOptions: uuid
- Edge Document API not supported?
- Cannot Simply Connect to Server...... HOT 2
- Secure connection to ArangoDB
- Query directly within a collection
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 arangoclient.net.