Skip to content
This repository has been 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

Open
mswokk opened this issue Aug 1, 2018 · 0 comments
Labels

Comments

@mswokk
Copy link

mswokk commented Aug 1, 2018

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()
}
@mswokk mswokk changed the title 'map' function in view fails when try to access a number type key of object. 'map' function in DesignDoc View fails when try to access a number type key of object. Aug 1, 2018
@djpongh djpongh added the icebox label Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants