Today I got an issue working with a file path which contains ” I wanted to save it to the database but I was unable to do.
The path is “C:NarendraWork”
Later I tried as “C:\Narendra\Work”
I am writing my experiences and learning to help others
Today I got an issue working with a file path which contains ” I wanted to save it to the database but I was unable to do.
The path is “C:NarendraWork”
Later I tried as “C:\Narendra\Work”
In my project I was inserting a project into a database and I need to assign the “id” created when project is inserted into database.
r.db(“DatabaseName”).table(“TableName”).insert(“Values”)
{
“deleted”: 0 ,
“errors”: 0 ,
“generated_keys”: [
“6538d988-f8e8-4ab0-bf71-f363fce91b9f”
] ,
“inserted”: 1 ,
“replaced”: 0 ,
“skipped”: 0 ,
“unchanged”: 0
}
The query to insert will provide a response as shown above and we can make use of the generated_keys to use for our purpose.
The database used is rethinkdb and query is written in reql language.
In rethink db when we want to have a row selected we can make use of this get.
table.get(key) will give us a single row. if there are no documents null is returned.
I have an Address object from my user interface like below
Address:{address1:”Franklin”,address2:”Warrensburg”,adress3:”Missouri}
so as i am sending an object i should be able to capture all the fields.
so i define a class as
public class Address
{
public string Address1 { get; set; }
public string Address2 { get; set; }
public string Address3 { get; set; }
}
and now when we get an object ,we get values as follows
[“Address”] = new JObject
{
[“Address1”] = _customer.Address.Address1, ===>Franklin
[“Address2”]= _customer.Address.Address2, ===>Warrensburg
[“Address3”] = _customer.Address.Address3 ===> Missouri
}
I faced this error while having a react js web application requesteing data from backend services which talk to our rethinkdb database.
The root cause was there were no tables created in the database and backend services are requiringn these tables to process the request.
So after creating the data tables and inserting data into the tables I was able to solve the error.