In the main libs I found; @s9tpepper's MongoAS3 lib, and JMCNet's full-mongo-flex-driver; there was no built-in way to get the collections in a database. If you've worked with Mongo before, you'll know that it's slightly important to know that.
Both libs provided access to the Mongo
runCommand()
command, but no combination of keys seemed to do the job. Of course, you could always just keep a static Array
of Strings
, but where's the fun in that?Other languages and drivers usually have a function along the lines of
getCollectionNames()
and with the help of @dun4n's google-fu, we found out how to do it. Mmmm, smells like a hack!How it works
So, for a database that looks like this: [...]Read more: Getting all the collection names with MongoDB and AS3
No comments:
Post a Comment