Which/where/how replica did the mongoimport used?

Hi,

mongoimport --drop /dataset/products.json --port 26000 -u “m103-admin”
-p “m103-pass” --authenticationDatabase “admin”
–db m103 --collection products

So how does mongoimport know which replica it should import to? Default to the primary shard? There is m103 on both primary and non-primary.

vagrant@m103:~/scripts$
vagrant@m103:~/scripts$ date
Sun Apr 28 04:09:22 UTC 2019
vagrant@m103:~/scripts$ mongo --port 27001 -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27001/?authSource=admin&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“bdf0576a-5721-4be7-9eb2-bc08abbd48da”) }
MongoDB server version: 3.6.12
Server has startup warnings:
2019-04-28T04:07:06.965+0000 I STORAGE [initandlisten]
2019-04-28T04:07:06.965+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-04-28T04:07:06.965+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
MongoDB Enterprise m103-repl:PRIMARY> show dbs
admin 0.000GB
applicationData 0.030GB
config 0.000GB
local 0.072GB
m103 0.030GB
test 0.000GB
testDatabase 0.000GB
MongoDB Enterprise m103-repl:PRIMARY>
bye
vagrant@m103:~/scripts$ mongo --port 27004 -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27004/?authSource=admin&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“65fd551a-9405-4595-b0ec-6bebef54e2db”) }
MongoDB server version: 3.6.12
Server has startup warnings:
2019-04-28T04:07:26.631+0000 I STORAGE [initandlisten]
2019-04-28T04:07:26.631+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-04-28T04:07:26.631+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
MongoDB Enterprise m103-repl-2:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 0.065GB
m103 0.042GB
MongoDB Enterprise m103-repl-2:PRIMARY>
MongoDB Enterprise m103-repl-2:PRIMARY> exit
bye
vagrant@m103:~/scripts$
vagrant@m103:~/scripts$

We are specifying port in mongoimport
Always on primary we do it

Hi

Are these two (2) databases different from each other then?

From m103-repl:
m103 0.030GB

From m103-repl-2
m103 0.042GB