This tutorial was totally cool! Props to the guy who made this, and for doing something like this while in his bored spare time... 1 complaint however is that it doesn't explain much about the difference between MongoDB and MySQL, or other databases. I was really hoping to get to hear how it compares, what the pros and cons are out of using this vs. other databases
I found this insanely helpful! At first I thought the tutorial was just a scripted app which only listened for the right queries to move on. I was a little blown away when I realized I could run other queries against the tutorial db.
once you get to lesson 10 or about, it limits the input quite a bit since the lessons start to build atop each other. Before that, or after you are done, you can do a lot.
The commands are executed against a real unicorns mongodb collection (each user having his or her own)...so you are only limited by what's been implemented in the javascript shell and on the thin proxy backend.
This does mean that someone who wanted to take the server down probably wouldn't have to try very hard.
Awesome tutorial. It's always fun to mess around with things like this.
I am running into a problem with sorting though. On lesson 6 I am sorting with {weight:1} which the tutorial says is wrong, but I get the same answer as sorting on {weight: -1} which is correct according to the tutorial. Or is this a mongodb thing?
Anyway, keep up the good work.
weight:-1 is correct..since you want the heaviest, you sort by weight descending. weight:1 should have returned documents in ascending order but wasn't working. It's fixed now on the tutorial..as well as in the core web console:
https://github.com/karlseguin/Mongo-Web-Admin/commit/761cd4e...
A few latency issues... or is it just tutorial related sluggishness or is it representative of Mongos' CAP tradeoffs? I guess 'eventually consistent' kicked in by the second find query. If that is what really happened, it is really cool to visualize 'eventually consistent'!
Output from back to back db.users.find() command. It took a while for Johnny to be updated to Cash.
Lesson 6 asks for 'Here's a tricky one: get ONLY the NAMES of the 2nd and 3rd heaviest male unicorns'
Which made me query:
db.unicorns.find({gender:'m'}, {name:1, _id:0}).sort({weight:-1}).skip(1).limit(2)
but it wants:
db.unicorns.find({gender:'m'}, {name:1}).sort({weight:-1}).skip(1).limit(2)
Hey, thanks! I didn't know you could exclude the _id like that...I can actually make us of that trick. Going to push out a new version with that, and a few other fixes, in a few.
After lesson 16 all the instructions disappeared and I was left with a white screen. Tried to go to a different lesson or the restart command but the instructions didn't come back. Couldn't replicate the problem unfortunately.
ya, I've seen this but I can't reproduce it either. Really have no idea. Refresh and lesson(17); should at least let you continue from where you left off.
The issue with that is if your DB gets backed and starts queuing writes, the timestamps will be skewed. Obviously this isn't always a show stopper, but a caveat nonetheless.
Actually the _id is usually created client-side so the timestamp will reflect when the application created the object rather than when it was processed by the DB. The only major exception is when the DB creates the _id for an upsert.
The DOM has exactly eight words of content and no forms or links at all. I'm worried about this trend of tutorials from authors who fail to get the very basics like progressive enhancement right. We should be showing pages with better authoring than average to novices, because most of the web will eventually converge on the quality of the average tutorial today.
(At least I think it's an easter egg, I didn't get all the way through. Maybe murdering unicorns is a normal part of the tutorial)