nl_tokens: Retrieves the ID of the business to which the document belongs
pl_tokens: function getBusinessId ( doc , oldDoc ) { var regex = / ^biz\.([A-Za-z0-9_-]+)(?:\..+)?$ / ; var matchGroups = regex . <mask> ( doc . _id ) ; if ( matchGroups ) { return matchGroups [ 1 ] ; } else if ( oldDoc && oldDoc . businessId ) { // The document ID doesn't contain a business ID, so use the property from the old document return oldDoc . businessId || null ; } else { // Neither the document ID nor the old document's contents contain a business ID, so use the property from the new document return doc . businessId || null ; } }