Azure Cosmos DB
An Azure NoSQL database service for app development.
1,454 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a UDF that is reformulating a document and returning a new document. Working well,
but the resulting document is returned as an attribute of the result; whereas, I would like it to be the TOP level.
SELECT udf.reformatDoc(c) AS X FROM c
-- Returns
{"x": {"inner": "Stuff from inner doc"}}
-- But, I want
{"inner": "Stuff from inner doc"}
Is there anyway to accomplish this in the query?