微信小程序云开发查询数据

index 里面

'use strict';
const db = uniCloud.database();
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	let res = {}
	if (event.action === 'screen') {
		//首页轮播
		res = await db.collection('home_screen').get()
	}


	//返回数据给客户端
	return res
};

 

 

猜你喜欢

转载自blog.csdn.net/m0_62248493/article/details/128920429
今日推荐