Skip to content

What This Adds In Cloud Code

  • Mature collection helpers used by many existing Nimbu projects.
  • Strong fit for map/filter/reduce and object shaping.
  • Good compatibility with legacy CoffeeScript Cloud Code.

Quick Start

js
const _ = require('underscore');
const active = _.where(request.params.users, { active: true });

API

Exposes standard underscore API (map, filter, find, groupBy, pluck, extend, etc.).

Practical Example

js
const _ = require('underscore');

const grouped = _.groupBy(request.params.orders, 'status');
const summary = _.mapObject(grouped, (items) => items.length);
response.success(summary);

Failure Modes & Gotchas

  • Chained underscore logic can get hard to read; keep transformations split.
  • Prefer one utility lib per file (underscore or lodash) for consistency.