Wrong document count with mixed _id type

I tried this, it still gives wrong count 29863 vs 30605. Only case it works fine is when I create two different RDDs, one with Aggregates.match(Filters.type(“_id”, “objectId”)) and Aggregates.match(Filters.not(Filters.type(“_id”, “objectId”))) and union both the RDDs. But this seems to be expensive compared to just a plain RDD creation.