News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

ServerGrove Blog:
Creating indexes for your Doctrine ODM documents with Symfony 2
October 08, 2010 @ 08:24:41

On the ServerGrove blog there's a new post showing you how to create indexes for your Doctrine ODM documents in a Symfony 2 application.

Creating indexes in NoSQL / Document-based databases is quite different compared to traditional relational databases. Since the former are schema-less (there is no table creation), indexes do not get created when the collection or the document is created or inserted. Here is a quick tip that will create all the indexes defined in your documents when using Symfony 2 and Doctrine ODM for MongoDB. Indexes are a great way to speed up your queries, in fact, it is a crime not to include them in your documents.

Adding the index is as easy as putting a new annotation on the property in its document class (for @Index) and run a bit of code in Symfony to build it out. The two lines you'll need to execute are included in the post.

7 comments voice your opinion now!
symfony document orm doctrine index tutorial


blog comments powered by Disqus

Similar Posts

DevShed: Working with Images and Text Flows in PDF Files with PHP 5

Gonzalo Ayuso: Sending automated emails with PHP, Swiftmailer and Twig

Wenbert Del Rosario's Blog: Registering your custom plugins in Zend Framework 1.8

Zend Developer Zone: Interview w/Francois Zaninotto & Fabien Potencier (Definitive Guide to symfony)

The Bakery: Ten New Tutorials/Components/Releases Posted


Community Events











Don't see your event here?
Let us know!


introduction composer code example opinion security component install package unittest hhvm facebook application language overview hack framework podcast symfony2 release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework