Closed kamlesh-nb closed 8 years ago
It should be possible. What have you tried? How did it not work?
I have tried below code..
namespace R = RethinkDB;
int main() {
string json; // assigned some json string to it
std::unique_ptr
}
Hope the code is correct. It always throws exception, RethinkDB Error. Could you please help with the sample code for insert, update and delete.
That seems to be missing a database reference.
Not sure of the syntax but it could be something like this:
R::db("the_database").table(... The rest of the statement
Alternative, it might be possible to set the current db using use()
.
Yes, I used database reference also, but it failed.
Please update the code, and some more information would be useful, e.g. the contents of the "json" setting and foremost; what does the error say?
I don't know much at all about this driver, but is string
actually the correct type to use as insert value?
Shouldn't it be some kind of mapping object?
@kamlesh-bambarde insert
takes as an argument an object or an array of objects, not a string.
This might work:
R::table("poll").insert(R::json(json)).run(*conn);
Is it possible to perform Insert, Update & Delete operations on the tables. I have tried querying the tables and it works fine, but Insert never worked. Could you please help.