bchavez / RethinkDb.Driver

:headphones: A NoSQL C#/.NET RethinkDB database driver with 100% ReQL API coverage.
http://rethinkdb.com/api/java
Other
383 stars 134 forks source link

Create a method to return result as raw json #139

Closed aliprogrammer69 closed 5 years ago

aliprogrammer69 commented 5 years ago

i need a method to run query on server and return result as raw json.

e.g : string result = R.Db(DbName).Table(TableName) .GetAll(R.Args(ids)) .RunAsRowJson(connection);

bchavez commented 5 years ago

Hi Ali,

If you need help, please have a look here in this section of the readme that outlines the help and support options for this driver.

Normally, GitHub issues here are mostly reserved for bug reports and issues surrounding changes to the driver source code.

aliprogrammer69 commented 5 years ago

Hi Brian, Thank for your reply. I just want a method to run query on server and return result as raw json and I can’t find a method like this.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Brian Chavez notifications@github.com Sent: Sunday, February 24, 2019 9:52:13 AM To: bchavez/RethinkDb.Driver Cc: Ali; Author Subject: Re: [bchavez/RethinkDb.Driver] Create a method to return result as raw json (#139)

Closed #139https://github.com/bchavez/RethinkDb.Driver/issues/139.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/bchavez/RethinkDb.Driver/issues/139#event-2159961764, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADFYVK3jXs7Ayx7kWocbjTXMwJWTQl-9ks5vQi-VgaJpZM4bOXNG.

bchavez commented 5 years ago

Hi Ali,

Perhaps I closed the issue too soon and probably should have explained a little more.

The proposal for .RunAsRowJson() is slightly ambiguous. The string result in the query is ambiguous because it requires a discussion to determine what result should be in terms of JSON.

string result = R.Db(DbName).Table(TableName)
                   .GetAll(R.Args(ids))
                   .RunAsRowJson(connection);

So, the proposal isn't quite as clear cut as it may seem.

What should .RunAsRowJson() return? I don't know.

My gut feeling is that you are probably looking for is the ReQL .ToJsonString() method. And this is why I originally suggested carrying the conversation over on Discord or Gitter.im if you need help using it.

Hope that helps, Brian

aliprogrammer69 commented 5 years ago

Hi Brain, Specially Thank for your response and appending time for my problem.

The Proposal for .RunAsRowJson() just is to create a method that returned server result as raw json string.

e.g. we have a table with name “channels” in rethinkDb which contains object below

{

Now I just wanna to receive raw json string from server without any serialize or deserialization. So .RunAsRowJson() should return server response as json string.

I don’t need to use Cursor, Result or other result types. Just raw string.

Thanks 😊

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10