oid_to_str#

langchain_mongodb.utils.oid_to_str(oid: Any) β†’ str[source]#

Convert MongoDB’s internal BSON ObjectId into a simple str for compatibility.

Instructive helper to show where data is coming out of MongoDB.

Parameters:

oid (Any) – bson.ObjectId

Returns:

24 character hex string.

Return type:

str