How to insert quoted text in Azure Cosmos DB?

Viewed 340

While creating nodes, we have to give properties of node right, in that property I've quoted text and make it as gremlin query.

Gremlin query is not executing if we have quotes in between string like can't, don't and L'oreal.

2 Answers

You could replace can't with can\'t.

enter image description here

Ran across this problem today. For those using Gremlin.Net and passing in a query string to g.SubmitAsync. If you are replacing any single quotes in a properties text using .Replace, include two slashes as c# removes the first one. So it will look something like;

$".property('height', '{account.Height.Replace( "'", "\\'" )}')"
Related