How do I suppress CosmosDB "default" info in resultsets?

Author: Matt Douhan

I want to suppress the CosmosDB information in the following resultset, how can that be done?

            "id": null,
            "_rid": null,
            "_self": null,
            "_ts": 0,
            "_etag": null,
            "topLevelCategory": "Shorts,Skirt"

This is an extract of course but I dont want to show the ID etc as they serve no purpose in this result but I cannot figure out how to suppress that info.

I expect the following

            "topLevelCategory": "Shorts,Skirt"

Query looks as follows

 $"SELECT DISTINCT locales.categories[0] AS topLevelCategory " +
                                                 $"FROM c JOIN locales in c.locales " +
                                                 $"WHERE = '{apiInputObject.Locale}' " +
                                                 $"AND locales.language = '{apiInputObject.Language}'";

Interesting thing is if I cast the result as a JOBJECT I dont get the system data, I only get it if I createDOcumentQuery as DOcument, so a workaround would be as follows

IQueryable<JObject> queryResultSet = client.CreateDocumentQuery<JObject>(UriFactory.CreateDocumentCollectionUri(databaseName, databaseCollection), parsedQueryObject.SqlStatement, queryOptions);

but that has other async issues but the above does not show the system generate IDs but the below one does

 var query = client.CreateDocumentQuery<Document>(UriFactory.CreateDocumentCollectionUri(databaseName, databaseCollection), parsedQueryObject.SqlStatement, queryOptions).AsDocumentQuery();
                        var result = await query.ExecuteNextAsync<Document>();

Originally Sourced from: