Skip to content

Instantly share code, notes, and snippets.

View sujeetkv's full-sized avatar
🎯
Focusing

Sujeet Kumar sujeetkv

🎯
Focusing
  • New Delhi, India
View GitHub Profile
@sujeetkv
sujeetkv / parser-bool-mongodb.py
Created September 25, 2018 08:06 — forked from woodywang/parser-bool-mongodb.py
A parser which convert SQL-like boolean expression into MongoDB condition expression.
import re
import json
OP_STACK = list()
ELEM_STACK = list()
COMP_STACK = list()
OP_MONGO_MAP = dict({
'AND': '$and',
'OR': '$or',