Replies: 1 comment 3 replies
-
@kathirsvn I think for stargate-mongoose, we should ask users to set
For the Does that help? |
Beta Was this translation helpful? Give feedback.
-
@kathirsvn I think for stargate-mongoose, we should ask users to set
For the Does that help? |
Beta Was this translation helpful? Give feedback.
-
Hi @vkarpov15
While running a test (called 'StargateMongoose - index') in tests/driver/index.test.ts, I've got a couple of questions (1. with respect to an option for the connect function 2. the 'await' for connect to complete). So I would like to understand more about this part of the mongoose library.
Code
Before trying to save any document in the
products
collection, the idea is that the 'createCollection' must be invoked for products' while connecting to the backend.Question 1:
The connect function has a set of options and one of them is 'autoCreate' which is set to
false
by default as per the doc, which takes care of creating collection automatically. Though, we don't set it totrue
, explicitly, how thecreateCollection
is called while invoking theconnect
function in the stargate-mongoose driver workflow?Question 2:
Without the below delay code, which I commented in the code above, the test sometimes fails with table doesn't exist error
So, why the
await mongoose.connect
call doesn't wait for thecreateCollection
call to be completed?cc: @jeffreyscarpenter @amorton
Beta Was this translation helpful? Give feedback.
All reactions