What do you think of Mongodb’s compound query?

  mongodb, question

Mongodb version: v3.4

db.h.reateIndex({'port':1});
 db.h.reateIndex({'geo.city':1});

When in use

db.h.find({'port':'80','geo.city':'Taipei'},{'port':1,'geo.city':1,'geo.country':1})

explain(‘executionStats’)

"executionStats" : {
 "executionSuccess" : true,
 "nReturned" : 280952,
 "executionTimeMillis" : 10056,
 "totalKeysExamined" : 879232,
 "totalDocsExamined" : 879232,
 "executionStages" : {
 "stage" : "PROJECTION",
 "nReturned" : 280952,
 "executionTimeMillisEstimate" : 9763,
 "works" : 879233,
 "advanced" : 280952,
 "needTime" : 598280,
 "needYield" : 0,
 "saveState" : 6915,
 "restoreState" : 6915,
 "isEOF" : 1,
 "invalidates" : 0,
 "transformBy" : {
 "port" : 1,
 "geo.city" : 1,
 "geo.country" : 1,
 },
 "inputStage" : {
 "stage" : "FETCH",
 "filter" : {
 "geo.city" : {
 "$eq" : "Taipei"
 }
 },
 "nReturned" : 280952,
 "executionTimeMillisEstimate" : 9246,
 "works" : 879233,
 "advanced" : 280952,
 "needTime" : 598280,
 "needYield" : 0,
 "saveState" : 6915,
 "restoreState" : 6915,
 "isEOF" : 1,
 "invalidates" : 0,
 "docsExamined" : 879232,
 "alreadyHasObj" : 0,
 "inputStage" : {
 "stage" : "IXSCAN",
 "nReturned" : 879232,
 "executionTimeMillisEstimate" : 466,
 "works" : 879233,
 "advanced" : 879232,
 "needTime" : 0,
 "needYield" : 0,
 "saveState" : 6915,
 "restoreState" : 6915,
 "isEOF" : 1,
 "invalidates" : 0,
 "keyPattern" : {
 "port" : 1
 },
 "indexName" : "port_1",
 "isMultiKey" : false,
 "multiKeyPaths" : {
 "port" : [ ]
 },
 "isUnique" : false,
 "isSparse" : false,
 "isPartial" : false,
 "indexVersion" : 2,
 "direction" : "forward",
 "indexBounds" : {
 "port" : [
 "[\"80\", \"80\"]"
 ]
 },
 "keysExamined" : 879232,
 "seeks" : 1,
 "dupsTested" : 0,
 "dupsDropped" : 0,
 "seenInvalidated" : 0
 }
 }
 }

Like the example above, is index used except for the port? Or both of them are used, if both are used, will a composite index be established?
Thank you

Answer by yourself, there is an index on it, but only a part of it.
If a composite index is established, it will be found faster.
Therefore, composite index is still needed for composite search.