Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a method to return result as raw json #139

Closed
aliprogrammer69 opened this issue Feb 24, 2019 · 4 comments
Closed

Create a method to return result as raw json #139

aliprogrammer69 opened this issue Feb 24, 2019 · 4 comments

Comments

@aliprogrammer69
Copy link

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
Copy link
Owner

bchavez commented Feb 24, 2019

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
Copy link
Author

aliprogrammer69 commented Feb 24, 2019 via email

@bchavez
Copy link
Owner

bchavez commented Feb 24, 2019

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);
  • Is result the semantic JSON result of the query?
  • Is result the raw JSON protocol response that is received from the server?
  • What about cursor responses as result JSON? Cursor response results that bypass the driver internal management can cause memory leaks on the server if opened cursors are not properly driven by the client.
  • ... and a whole slew of many other issues as well.

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
Copy link
Author

aliprogrammer69 commented Feb 24, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants