cursor.map()

在本页面

cursor.map()方法具有以下参数:

Parameter Type Description
function function 应用于光标所访问的每个文档的功能。

Example

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

See also

cursor.forEach()用于类似的功能。

首页