> On Jun 11, 2015, at 8:45 PM, Brendan Duddridge <[email protected]> wrote: > > So somehow I need to be able to generate a map/reduce function that will > extract the values from the TFRecord entity based on the keys from the above > vars. But according to the documentation, the map/reduce functions must be > pure and not reference any external state information, only referencing > values from the document JSON itself.
It can’t reference any variable external state. If the view definition uses an external value, but that value never changes, that’s fine. The exact requirement is that, given the same input document, the map function must always emit the same output. It sounds like it’s fine for the view to reference values from the TFRecord. You can fetch those values into local variables, then define the view and use those variables. The block will adopt and hold onto those values. What you’ll need to do, though, is notice when the TFRecord changes and update the view’s map function and version string (which will rebuild the index.) —Jens -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/58EBAF03-4DD0-46CE-B1BA-98A90EB6EBB5%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
