You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I want create a datasource to connect with mongoDB database,then I read the document ,I enter the lb4 datasource in the CLI. when I finish the creation of the datasource, the .datasource.ts file as follows:
I expect after I finish the creation of the datasource,the testdb will automatically created in the MongoDB.
Actual
when I exeute the mongod.exe, and open the CLI, then input:
show dbs
the output is :
3dcmsT 0.000GB
admin 0.000GB
config 0.000GB
local 0.000GB
vote_rule 0.001GB
there is no testdb as I expected!!!
what should I do to use lb4 datasource to connect the MongoDB server?
when I using loopback 3 to enter lb datasource ,the loopback will create the database automatically ,and I check the mongoDB,I also can see the new database when I define in the config.
but when I use loopback 4 to do the same thing,it is not work?!
It there angthing additional I should know to get my expection done ?
LoopBack 4 does not perform auto-migration on every startup. On most projects ,npm run migrate can be used to run auto-update. The --rebuild flag can be used to perform a full, destructive auto-migrate.
OK,and I check the document again,and find that the repository is the essential part of connetor of mongoDB,as for when I use lb4 datasource to create a connector configuration file ,then it will indeed not create an database automatically!
and after I create a controller of a test model ,then I post an data instance of it.
as a result, when I check the db list in mongoDB CLI,the new database shows in the list.
in conclusion, the database will not create before there is no data record in it.
Describe the bug
Desciption of the bug
when I want create a datasource to connect with mongoDB database,then I read the document ,I enter the
lb4 datasource
in the CLI. when I finish the creation of the datasource, the .datasource.ts file as follows:Expect
I expect after I finish the creation of the datasource,the testdb will automatically created in the MongoDB.
Actual
when I exeute the mongod.exe, and open the CLI, then
input:
the output is :
there is no testdb as I expected!!!
what should I do to use
lb4 datasource
to connect the MongoDB server?when I using loopback 3 to enter
lb datasource
,the loopback will create the database automatically ,and I check the mongoDB,I also can see the new database when I define in the config.but when I use loopback 4 to do the same thing,it is not work?!
It there angthing additional I should know to get my expection done ?
Logs
No response
Additional information
No response
Reproduction
https://codesandbox.io/s/nifty-wilson-4u0mdy
The text was updated successfully, but these errors were encountered: