View by first level child objects

Hi guys,

Is there some way to create a view that would have a first (indexed) field a first level fields in the JSON.

For instance:

A view would then return something like


Hi Arkadyb,
I’m not sure I understand what you are trying to achieve, could you perhaps try to explain it in a different way?

In generel you have a high level of freedom in the map’ing function for the view to build the view for the needs you have. The main limitation is that you can not call anything out site the map’ing function. In your case this means that you should be able to retrieve the “documentid” from the document it self.
The view will always return json.


If you want to do what I think you want to do, this should work:

function (doc, meta) {
    for (var property in doc) {
      if (doc.hasOwnProperty(property)) {

I’ve not tested it, but that should do what you want.