Skip to content

Instantly share code, notes, and snippets.

View theoctober19th's full-sized avatar
🏠
Working from home

bikalpa theoctober19th

🏠
Working from home
View GitHub Profile
@RandallShanePhD
RandallShanePhD / objectids.py
Created July 28, 2014 20:59
Decode and Encode object ids in MongoDB using pymongo
# MongoDB Object ID decode
# Randall Shane, PhD
# RShane@BaseXVI.com
# BaseXVI.com
# 28 July 2014
'''MongoDB creates a unique id ('_id' key) for every document
which is a 12 byte object comprised of 4 parts as follows:
time stamp: 4 bytes