Query is not a function

I’m initializing my pinecone client and connecting to the pinecone DB as follows:

import { PineconeClient } from '@pinecone-database/pinecone';

  this.pinecone = new PineconeClient()
    this.pinecone.init({
      apiKey: process.env.PINECONE_API_KEY,
      environment: 'asia-northeast1-gcp'
    }).then(()=>console.log('pinecone initialized'))

But when I try querying:

const { matches } = await this.pinecone.query({
     vector,
     topK: 10,
     includeMetadata: true,
     includeValues: false,
   });

I get:

TypeError: this.pinecone.query is not a function

@bolek were you able to move past this? I apologize for the late reply. If you’re still working on it, can you share where vector was defined?