
复制const userCursor = await collection.find(); // 如果没有返回数据,系询游需要做一些特殊处理的
IT技术网列数
,
企商汇可以使用 userCursor.count() 或 userCursor.hasNext() if (!await userCursor.count()) { // TODO: 提前结束,
亿华云计算据查
标用做一些其它操作 return; } // 方法一: for await (const userof userCursor) { } // 方法二: while (await userCursor.hasNext()) { const doc = userCursor.next(); } 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.