Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:42:29+00:00 2026-06-13T00:42:29+00:00

in announcement 0.6.0 includes basic ODM (object-document mapper) for MongoDB can anybody provide a

  • 0

in announcement

0.6.0 includes basic ODM (object-document mapper) for MongoDB

can anybody provide a little more information?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:42:30+00:00Added an answer on June 13, 2026 at 12:42 am

    Phalcon 0.6.0 will provide a ODM to manipulate Mongo documents in an object oriented way. This isn’t the definitive usage, but it’ll give you an idea:

    <?php
    
    //Register the mongo db connection in the DI
    $di->set('mongo', function() {
         $mongo = new Mongo("mongodb://localhost");
         return $mongo->selectDB('invo');
    });
    
    //Register a collection manager
    $di->set('collectionManager', function() {
         return new Phalcon\Mvc\Collection\Manager();
    });
    
    //A model that maps to the products collection
    class Products extends Phalcon\Mvc\Collection
    {
    
    }
    
    //Create a document
    $product = new Products();
    $product->name = 'Artichoke';
    $product->status = 'Active';
    $product->save();
    
    //Create another document
    $product = new Products();
    $product->name = 'Carrots';
    $product->price = 15.20;
    $product->status = 'Active';
    $product->save();
    
    //Updating a product
    $product = Products::findFirst();
    $product->status = 'Inactive';
    $product->save();
    
    //Deleting a product
    $product = Products::findFirst();
    $product->delete();
    
    //Finding documents
    $products = Products::find();
    foreach($products as $product){
       echo $product->name;
    }
    
    $products = Products::find(array(
          'conditions' => array('$gt' => array('price', '5')),
          'sort' => array('name' => 1),
          'limit' => 2
    ));
    

    Since this feature is in full development, some aspects may change until the final version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a php portal. i did an announcement section where user can
When I add a new item in a default Announcement list using the GUI
Given the following JSON data: [ { pk: 2, model: corkboard.announcement, fields: { body:
I noticed when the MVC4 beta was announced, it includes a new Web-API .
With the announcement of the Motodev core plugins being included in the AOSP tools
In response to the announcement that WordPress 3.2 (due later this month) will require
I'm implementing a Announcement system that is loosely based on this article: https://web.archive.org/web/20211020111733/https://www.4guysfromrolla.com/articles/110409-1.aspx One
In Steve Jobs' keynote announcement of the iPhone SDK 4 earlier this year, one
I've a announcement table with the structure, Msgid int, title varchar(150) message text date_from
My application makes a short announcement once in a while, either via TextToSpeech or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.