Единственный результат, который я получаю:
{ "домен": { "домен": NULL, "_ события": {}, "_ eventsCount": 1, "члены": []}}
const functions = require('firebase-functions');
const {BigQuery} = require('@google-cloud/bigquery');
export default functions.https.onRequest((req, response) => {
var result = queryBigQuery();
response.status(200).send(JSON.stringify(result));
})
async function queryBigQuery() {
var bigQuery = new BigQuery({ projectId: 'project-id', keyFilename: "src/credentials-name.json" });
await bigQuery.query({
query: 'SELECT * from `project-id.firebase_predictions.com_project_app_ANDROID` LIMIT 10',
timeoutMs: 10000,
useLegacySql: false
}).then( (data) => {
return data[0];
}).catch( (error) => {
return error;
});
}