Peter Lawrence
Peter Lawrence

Reputation: 5

How to convert YY format to YYYY format in pymongo

I have a collection called members and here is a sample data:

{
    "_id": 123,
    "name": "Jackie",
    "dob": "31/12/18"
}

Is it possible to convert the dd/mm/yy format to dd/mm/yyyy? As $dateFromString only accepts the latter.

(p.s. $toString/$toInt/$toDecimal is not supported as the MongoDB version is before version 4)

Upvotes: 0

Views: 41

Answers (1)

Related Questions