What does the warning "emit() called with nil key; ignoring" mean

I have just upgraded to couchbase-lite 1.3.1 on iOS and am seeing a lot of these warnings. Is it anything to worry about? How do I eliminate them?

Don’t pass nil as the first parameter to emit() in your map functions :slight_smile:

If you’re doing that because you don’t want to emit anything, then just don’t call emit at all for that document.

Thanks. It was actually a typo in a couple of places where we emitted id instead of _id. We never actually use the key in the result as we go straight to the document property.

It’s more efficient to use the key, FYI. Accessing the Document triggers another database read, whereas the key and value have already been read into memory as part of the query. (That’s also why it’s good to emit the document properties you need as part of the value.)

Good to know, thanks.