Skip to content

Instantly share code, notes, and snippets.

@imlucas
Last active March 2, 2020 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imlucas/0a04f642a81a38c957cb9f7f35487f72 to your computer and use it in GitHub Desktop.
Save imlucas/0a04f642a81a38c957cb9f7f35487f72 to your computer and use it in GitHub Desktop.

Allowing really long collection names in MDB

I was trying to think of test cases for implications of allowing collection names to have a length filling the be 16Mb boundary on a meta document and ascii-art came to mind.

To make a new collection from an image:

npm i -g ascii-art; 
ascii-art image -B 32 -a solid ~/Desktop/IMG_0099.jpg > arlo.ascii; 
export ARLO_ASCII=`cat arlo.ascii`;
mongo --eval "db.createCollection(\`$ARLO_ASCII\`)";

Screenshot 2020-02-28 13 50 25

Looping means show collections now works as an excellent ascii photo gallery:

Screenshot 2020-02-28 15 06 52

@imlucas
Copy link
Author

imlucas commented Mar 2, 2020

Screenshot 2020-02-28 13 50 25
Screenshot 2020-02-28 15 06 52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment