云函数的调用问题

调用数据库有什么限制吗?在同一个页面提出一个方法里面也不可以调db.collection…方法,foreach里面貌似也不能调,提示{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:“Unexpected identifier”}错误。
调用数据库有什么限制吗?在同一个页面提出一个方法里面也不可以调db.collection…方法,foreach里面貌似也不能调,提示{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:“Unexpected identifier”}错误。