cursor.map()

cursor.map(function)
参数:
  • function – function to apply to each document visited by the cursor.

Apply function to each document visited by the cursor, and collect the return values from successive application into an array. Consider the following example:

db.users.find().map( function(u) { return u.name; } );

也可以参考

cursor.forEach() for similar functionality.

MongoDB Manual (Index)

关于

生态系统

格式

资源