Skip to main content
Smart segments migrate quickly. The syntax is very similar to the legacy agent. The main difference is in the return value.

What changed

Because the new agent is designed to work with multiple databases, the return value of the segment handler is no longer a Sequelize/Mongoose condition. Instead, you build a condition tree that the agent translates to the appropriate database syntax.

API cheatsheet (Node.js)

Performance tip

Many queries map directly to Forest condition trees, giving much better performance than performing the query yourself and then building a naive id IN (...) condition.

Example