This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| MongoLite-Py: A MongoDB-like library for in-memory Python dicts and lists, | |
| supporting both query expressions and an aggregation pipeline. | |
| """ | |
| import re | |
| import json | |
| import math | |
| import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| MongoLite: A MongoDB‑like library for in‑memory POJOs, | |
| supporting both query expressions (filtering) and an aggregation pipeline. | |
| Updated to TypeScript and enhanced with: | |
| – New operators: $slice and $filter | |
| – Modern JS features: optional chaining (?.), nullish coalescing (??), Array.prototype.at() | |
| – Simple pipeline optimization (merging consecutive $match stages) | |
| – Cursor support via async iterators | |
| – Some improvements in array operation efficiency (e.g. in $addToSet) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <sys/mman.h> | |
| #include <sys/stat.h> | |
| #include <semaphore.h> | |
| #define SHM_NAME "/my_shared_memory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <sys/mman.h> | |
| #include <sys/stat.h> | |
| #include <semaphore.h> | |
| #define SHM_NAME "/my_shared_memory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <sys/mman.h> | |
| #include <sys/types.h> | |
| #include <pthread.h> | |
| typedef struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {rkey:{key: r[key] for key in header} for rkey, r in z.items()} |