Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

'map' function in DesignDoc View fails when try to access a number type key of object. #149

@mswokk

Description

@mswokk

RN Couchbase lite : 0.6.1
OS : Android

When I try to access number type key in map function, it stops to work.
For example.

const docToCreate = {
   0 : { data:"any" },  // key type is a number
   stringKey : "value"
}

... 

view: {
   map: function (doc, meta) {
      var v = doc ['0'];  // Fails
      Object.values(doc); // Fails
      Object.entries(doc); // Fails 

      Object.keys(doc); // Works
      var str = doc.stringKey; // Works
      var str = doc['stringKey']; // Works
   }.toString()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions