MongoDB findAndModify() with aggregation

Benjamin Thompson b.thompson at latera.ru
Fri Mar 20 13:05:26 CET 2020


Hi

The findAndModify() method was recently updated to support
aggregation. This means that the "update" parameter now accepts two
different sytaxes:

Old syntax (no aggregation):
db.collection.findAndModify(query: { ... }, update: { ... } )

New syntax (with aggregation):
db.collection.findAndModify(query: { ... }, update: [ ... ] )

The difference being that square bracket are used instead of curly
bracktes for the aggregation pipeline.

The first syntax works with FreeRADIUS but the second syntax gives the error:

rlm_sql_mongo: 'update' does not hold a document.

If there is any possiblitly to support the aggregation option then I
think this would be very useful as it allows much more complex data
processing inside the request.

-- 
Ben Thompson


More information about the Freeradius-Users mailing list