Are stringified MongoDB ObjectID's safe as folder names?

44 views Asked by At

As it says on the tin. I'd like to name folders corresponding to "Channels." I'd personally rather use the human-readable name but I was told halfway through development that names cannot be static (for some reason)

1

There are 1 answers

0
Martin Konecny On BEST ANSWER

Yes ObjectId's are safe as folder names if by safe you mean are they valid folder name.

For example, an ObjectId is a hex value of characters 0-9 and a-z of length 24, which will always be a valid folder name.

If you mean to ask if the ObjectId carries some sensitive information, you should know that it has the date its corresponding document was created embedded in it. Someone with access to the ObjectId would be able to discover when it was created. Whether this is a concern is up to you.