Database

[{"id":"12345"},{"id":"123"}]

Query

db.collection.aggregate([{$match:{$expr:{$eq:[{$substr:["$id",0,4]},"1234"]}}}])

Result