MongoDB doesn’t support unique indexes on embedded documents in the same document. However, it does support some scenarios for adding unique indexes on embedded documents. When you apply a unique index to an embedded document, MongoDB treats it as unique in the collection. The following is an example of setting up a unique index on an embedded document:
Setting Up Multiple Browsers on Mac OS X
When doing web development, you need to test your work on many operating systems and browsers. Depending on your host operating system, you will also need to run virtual machines to test other operating systems and browsers. For this article, we are focusing on setting up different browsers/version on OS X (10.6 - Snow Leopard).
For Mac, the most common browsers are Safari, Firefox, Opera and recently Chrome. On my machine, I have setup the following browsers and versions:
- Safari: 2.04, 3.04, 3.12, 3.21, 4.04
- Firefox: 2.0.0.20, 3.0.17, 3.5.7
- Opera: 9.52, 9.64, 10.01, 10.10
- Chrome: 4.0.249.49 (Latest)
Announcing Reserved Word Search. Find Reserved Words Instantly as You Type!
To keep things rolling, I’ve released another project called Reserved Word Search. With Reserved Word Search you can instantly find reserved words as you type. This is extremely useful when doing database design and/or designing an API.
So go ahead and check out Reserved Word Search @ www.reservedwordsearch.com.
MySQL: Created & Modified Date Fields
I’ve been searching for an efficient way to set created and modified date fields in MySQL. Of course, this can be done in the application you’re writing, however, I wanted to find a way to automatically do this on the database layer.
Please note, this approach is targeted for MySQL 5.0+.
The approach I take here is a combination of using the TIMESTAMP field data type and a TRIGGER.
Introducing GistDoIt! Run Your Gists and See the Output!
For the past couple of months, I’ve been working on a mashup service between gist.github.com and ideone.com. The service allows someone to execute a gist and view the results.
For more information, please check out GistDoIt! @ www.gistdoit.com.