Escape JSON Value and UPSERT

I have a json value "path" : "\\\\SERVERNAME\\Extracts\\ABC\\Outbound\\" which is a valid JSON String. But upsert fails with this in N1QL. Is there something wrong with this?

could you provide full N1QL query?

UPSERT INTO default (KEY, VALUE) VALUES ("clientConfig::sample", {
"path" : "\\\\SERVERNAME\\Extracts\\ABC\\Outbound\\",
"file" : "abc.txt"
}) RETURNING * ;

interesting, it seems like it is sensitive to trailing \\ in the "path" attribute, without it, it works.

cc @geraldss

Hey there, I am getting the same error when i use this

UPSERT INTO edc (KEY, VALUE) VALUES ("clientConfig::sample", 
{
"path" : "\\SERVERNAME\\Extracts\\ABC\\Outbound\\",
"file" : "abc.txt"
}) RETURNING * ;

Error is

[
  {
    "code": 3000,
    "msg": "syntax error - at file",
    "query_from_user": "UPSERT INTO edc (KEY, VALUE) VALUES (\"clientConfig::sample\", \n{\n\"path\" : \"\\\\SERVERNAME\\\\Extracts\\\\ABC\\\\Outbound\\\\\",\n\"file\" : \"abc.txt\"\n}) RETURNING * ;"
  }
]

Adding @marcog. This may be fixed in more recent versions or in the developer build.

I am sorry I have limited connectivity and I can’t check it out - but I don’t believe we have actually addressed that sort of issue.
The underlying issue is that the final backslash escapes the double quote, so the scanner is terminating the string at the double quote preceeding file.
I’ll check it out as soon as I can.

Marco

Thank you. Please let us know. We are on 4.5.1

It looks like a bug. Can you try single quotes instead of double quotes. You can try a Unicode escape for the trailing backslash.