MongoDB + Java - Everything you need to know Norberto Leite
Ā
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
MongoDB + Java - Everything you need to know Norberto Leite
Ā
Learn everything you need to know to get started building a MongoDB-based app in Java. We'll explore the relationship between MongoDB and various languages on the Java Virtual Machine such as Java, Scala, and Clojure. From there, we'll examine the popular frameworks and integration points between MongoDB and the JVM including Spring Data and object-document mappers like Morphia.
PHP Data Objects (PDO) provides a clear, simple (but powerful), unified API for working with all our favorite databases. Features include prepared statements with bound parameters (for all databases, even those that donāt natively support them), transactions, cursors, LOBs, and flexible error handling.
PHP 5.3 and Lithium: the most rad php frameworkG Woo
Ā
Presentation given to the Orange County PHP meetup on Feb 24 2010. The presentation covers the new features in php 5.3 and goes on to show how they are used in Lithium, the most rad php framework.
Webinar: MongoDB Persistence with Java and MorphiaMongoDB
Ā
MongoDB is the leading noSQL database and as with any new technology, some of the biggest questions are about tools and integration. This webinar will cover how to use MongoDB from a Java application and introduce Morphia, the object document mapping library. It will cover the essential features of the framework with examples before moving on to some of the more advanced and upcoming features such as text search and aggregation framework support.
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
This session introduces most well known design patterns to build PHP classes and objects that need to store and fetch data from a relational databases. The session will describe the difference between of the Active Record, the Table and Row Data Gateway and the Data Mapper pattern. We will also examine some technical advantages and drawbacks of these implementations. This talk will expose some of the best PHP tools, which ease database interactions and are built on top of these patterns.
Java Persistence Frameworks for MongoDBTobias Trelle
Ā
After a short introduction to the MongoDB Java driver we'll have a detailed look at higher level persistence frameworks like Morphia, Spring Data MongoDB and Hibernate OGM with lots of examples.
This webinar will walk you through building a simple location-based check-in app in MongoDB. Weāll cover the basics of MongoDBās document model, query language, map reduce framework, and deployment architecture.
In this webinar you will discover:
- Why MongoDB is being adopted in organizations large and small
- How easy it is to start building applications with MongoDB
- Key features for manipulating and accessing data
- High availability and scale-out architecture
PHP Data Objects (PDO) provides a clear, simple (but powerful), unified API for working with all our favorite databases. Features include prepared statements with bound parameters (for all databases, even those that donāt natively support them), transactions, cursors, LOBs, and flexible error handling.
PHP 5.3 and Lithium: the most rad php frameworkG Woo
Ā
Presentation given to the Orange County PHP meetup on Feb 24 2010. The presentation covers the new features in php 5.3 and goes on to show how they are used in Lithium, the most rad php framework.
Webinar: MongoDB Persistence with Java and MorphiaMongoDB
Ā
MongoDB is the leading noSQL database and as with any new technology, some of the biggest questions are about tools and integration. This webinar will cover how to use MongoDB from a Java application and introduce Morphia, the object document mapping library. It will cover the essential features of the framework with examples before moving on to some of the more advanced and upcoming features such as text search and aggregation framework support.
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
This session introduces most well known design patterns to build PHP classes and objects that need to store and fetch data from a relational databases. The session will describe the difference between of the Active Record, the Table and Row Data Gateway and the Data Mapper pattern. We will also examine some technical advantages and drawbacks of these implementations. This talk will expose some of the best PHP tools, which ease database interactions and are built on top of these patterns.
Java Persistence Frameworks for MongoDBTobias Trelle
Ā
After a short introduction to the MongoDB Java driver we'll have a detailed look at higher level persistence frameworks like Morphia, Spring Data MongoDB and Hibernate OGM with lots of examples.
This webinar will walk you through building a simple location-based check-in app in MongoDB. Weāll cover the basics of MongoDBās document model, query language, map reduce framework, and deployment architecture.
In this webinar you will discover:
- Why MongoDB is being adopted in organizations large and small
- How easy it is to start building applications with MongoDB
- Key features for manipulating and accessing data
- High availability and scale-out architecture
After a short introduction to the Java driver for MongoDB, we'll have a look at the more abtract persistence frameworks like Morphia, Spring Data, Jongo and Hibernate OGM.
This presentation was given at the LDS Tech SORT Conference 2011 in Salt Lake City. The slides are quite comprehensive covering many topics on MongoDB. Rather than a traditional presentation, this was presented as more of a Q & A session. Topics covered include. Introduction to MongoDB, Use Cases, Schema design, High availability (replication) and Horizontal Scaling (sharding).
Dev Jumpstart: Build Your First App with MongoDBMongoDB
Ā
New to MongoDB? This talk will introduce the philosophy and features of MongoDB. Weāll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app to store books. Weāll cover inserting, updating, and querying the database of books. This session will jumpstart your knowledge of MongoDB development, providing you with context for the rest of the day's content.
Dev Jumpstart: Build Your First App with MongoDBMongoDB
Ā
New to MongoDB? This talk will introduce the philosophy and features of MongoDB. Weāll discuss the benefits of the document-based data model that MongoDB offers by walking through how one can build a simple app. Weāll cover inserting, updating, and querying the database of books. This session will jumpstart your knowledge of MongoDB development, providing you with context for the rest of the day's content.
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
Ā
Slides of my MongoDB Training given at Coding Serbia Conference on 18.10.2013
Agenda:
1. Introduction to NoSQL & MongoDB
2. Data manipulation: Learn how to CRUD with MongoDB
3. Indexing: Speed up your queries with MongoDB
4. MapReduce: Data aggregation with MongoDB
5. Aggregation Framework: Data aggregation done the MongoDB way
6. Replication: High Availability with MongoDB
7. Sharding: Scaling with MongoDB
Similar to Symfony Day 2010 Doctrine MongoDB ODM (20)
Come to this talk prepared to learn about the Doctrine PHP open source project. The Doctrine project has been around for over a decade and has evolved from database abstraction software that dates back to the PEAR days. The packages provided by the Doctrine project have been downloaded almost 500 million times from packagist. In this talk we will take you through how to get started with Doctrine and how to take advantage of some of the more advanced features.
Doctrine 2: Enterprise Persistence Layer for PHPJonathan Wage
Ā
Doctrine 2 is an object relational mapper (ORM) for PHP 5.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. This provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
Ā
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
Ā
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Ā
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
DevOps and Testing slides at DASA ConnectKari Kakkonen
Ā
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Ā
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
Ā
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more āmechanicalā approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
Ā
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
Ā
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Ā
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Ā
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
š Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Ā
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
2. Doctrine MongoDB Object Document Manager #sfdaycgn
What is Doctrine?
www.doctrine-project.org www.sensiolabs.org
3. Doctrine MongoDB Object Document Manager #sfdaycgn
What is Doctrine?
ā¢ Open source PHP project started in 2006
ā¢ Relational database abstraction layer.
ā¢ mysql, oracle, pgsql, sqlite, etc.
ā¢ Object persistence layers for RDBMS,
MongoDB, etc.
ā¢ Other database related functionalities.
http://www.doctrine-project.org
www.doctrine-project.org www.sensiolabs.org
4. Doctrine MongoDB Object Document Manager #sfdaycgn
What is MongoDB?
ā¢ Key-Value document based storage
system.
ā¢ Bridge between traditional relational
databases and key-value data stores.
http://www.mongodb.org
www.doctrine-project.org www.sensiolabs.org
10. Doctrine MongoDB Object Document Manager #sfdaycgn
Inserting Documents
Insert a new user document and echo the newly generated id
$user = array(
'username' => 'jwage',
'password' => md5('changeme')
'active' => true
);
$coll->insert($user);
echo $user['_id'];
www.doctrine-project.org www.sensiolabs.org
11. Doctrine MongoDB Object Document Manager #sfdaycgn
Updating Documents
Update username and password and save the whole document
$user = $coll->findOne(array('username' => 'jwage'));
$user['username'] = 'jonwage';
$user['password'] = md5('newpassword');
$coll->save($user);
www.doctrine-project.org www.sensiolabs.org
12. Doctrine MongoDB Object Document Manager #sfdaycgn
Atomic Updates
ā¢ Faster than saving the entire document.
ā¢ Safer than updating the entire document.
ā¢ Updates are done in place and are atomic.
www.doctrine-project.org www.sensiolabs.org
14. Doctrine MongoDB Object Document Manager #sfdaycgn
Atomic Updates
Many other atomic operators exist for manipulating a documents data
ā¢ $inc - increments ļ¬eld by the number value
ā¢ $set - sets ļ¬eld to value
ā¢ $unset - deletes a given ļ¬eld
ā¢ $push - appends value to an array
ā¢ $pushAll - appends multiple values to an array
ā¢ $addToSet - appends multiple values to an array that donāt already exist in the
array
ā¢ $pop - removes the last element in an array
ā¢ $pull - removes all occurrences of a value from an array
ā¢ $pullAll - removes all occurrences of multiple values from an array
www.doctrine-project.org www.sensiolabs.org
17. Doctrine MongoDB Object Document Manager #sfdaycgn
DocumentManager
ā¢ Abstraction on top of the PHP Mongo
class
ā¢ Manages the persistent state of PHP
objects
ā¢ Implements UnitOfWork for change
tracking
http://martinfowler.com/eaaCatalog/unitOfWork.html
www.doctrine-project.org www.sensiolabs.org
18. Doctrine MongoDB Object Document Manager #sfdaycgn
Document States
ā¢ A NEW document instance has no persistent identity, and is not yet
associated with a DocumentManager (i.e. those just created with the
"new" operator).
ā¢ A MANAGED document instance is an instance with a persistent
identity that is associated with an DocumentManager and whose
persistence is thus managed.
ā¢ A DETACHED document instance is an instance with a persistent
identity that is not (or no longer) associated with an
DocumentManager.
ā¢ A REMOVED document instance is an instance with a persistent
identity, associated with an DocumentManager, that will be removed
from the database upon transaction commit.
www.doctrine-project.org www.sensiolabs.org
20. Doctrine MongoDB Object Document Manager #sfdaycgn
Deļ¬ning Document
A document is just a regular oleā PHP class
class User
{
private $id;
private $username;
private $password;
public function getId()
{
return $this->id;
}
public function getUsername()
{
return $this->username;
}
public function setUsername($username)
{
$this->username = $username;
}
public function getPassword()
{
return $this->password;
}
public function setPassword($password)
{
$this->password = md5($password);
}
}
www.doctrine-project.org www.sensiolabs.org
22. Doctrine MongoDB Object Document Manager #sfdaycgn
Ready to Go
Doctrine now knows about this document and is able
to manage its persistent state
www.doctrine-project.org www.sensiolabs.org
27. Doctrine MongoDB Object Document Manager #sfdaycgn
Query API
Fluent OO Query API
www.doctrine-project.org www.sensiolabs.org
28. Doctrine MongoDB Object Document Manager #sfdaycgn
Querying MongoDB
Directly
// Get user array directly from mongo
$user = $mongo->db->users->findOne(array('username' => 'jwage'));
Returns an array of information and not a User object
www.doctrine-project.org www.sensiolabs.org
29. Doctrine MongoDB Object Document Manager #sfdaycgn
Querying Through
Doctrine
// Get user class instance through Doctrine
$user = $dm->findOne('User', array('username' => 'jwage'));
Going through Doctrine gives you managed objects back instead of arrays
www.doctrine-project.org www.sensiolabs.org
30. Doctrine MongoDB Object Document Manager #sfdaycgn
Querying Through
Doctrine Query API
// Get user class instance through Doctrine Query API
$user = $dm->createQuery('User')
->field('username')->equals('jwage')
->getSingleResult();
Query for same user using the Query API
www.doctrine-project.org www.sensiolabs.org
31. Doctrine MongoDB Object Document Manager #sfdaycgn
Querying Through
Doctrine Query API
// Find posts within a range of dates
$posts = $dm->createQuery('Post')
->field('createdAt')->range($startDate, $endDate)
->execute();
www.doctrine-project.org www.sensiolabs.org
44. Doctrine MongoDB Object Document Manager #sfdaycgn
References
MongoDB does not have joins or foreign keys but you
can still store references to other documents and
resolve the references in your application code.
Doctrine abstracts the handling of referneces for you
so working with them is seamless.
www.doctrine-project.org www.sensiolabs.org
54. Doctrine MongoDB Object Document Manager #sfdaycgn
UnitOfWork
ā¢ Tracks changes in objects between ļ¬ushes
ā¢ Maintains copy of old values to compare
new values to
ā¢ Changesets computed and persisted in
the most efļ¬cient way using atomic
operators $inc, $set, $unset, $pullAll,
$pushAll, etc.
www.doctrine-project.org www.sensiolabs.org
55. Doctrine MongoDB Object Document Manager #sfdaycgn
Other Features
www.doctrine-project.org www.sensiolabs.org
56. Doctrine MongoDB Object Document Manager #sfdaycgn
Document Query
Language
Language for querying documents in a similar way to
SQL
www.doctrine-project.org www.sensiolabs.org
61. Doctrine MongoDB Object Document Manager #sfdaycgn
Paging Results
$users = $dm->query('find all FROM User limit 30 skip 30');
www.doctrine-project.org www.sensiolabs.org
62. Doctrine MongoDB Object Document Manager #sfdaycgn
Selecting Slice of
Embedded Documents
$post = $dm->query('find title, comments limit 20 skip 10 FROM
BlogPost WHERE id = ?', array($id));
www.doctrine-project.org www.sensiolabs.org
63. Doctrine MongoDB Object Document Manager #sfdaycgn
Other Examples
// Find all posts greater than or equal to a date
$posts = $dm->query('find all FROM BlogPost WHERE createdAt >= ?',
array($date));
// Find all posts sorted by created at desc
$posts = $dm->query('find all FROM BlogPost sort createdAt desc');
// Update user
$dm->query('update DocumentsUser set password = ? where username = ?',
array('newpassword', 'jwage'));
www.doctrine-project.org www.sensiolabs.org
65. Doctrine MongoDB Object Document Manager #sfdaycgn
āA lifecycle event is a regular event with the additional
feature of providing a mechanism to register direct
callbacks inside the corresponding document classes
that are executed when the lifecycle event occurs.ā
http://www.doctrine-project.org/projects/mongodb_odm/1.0/docs/reference/events/en#lifecycle-callbacks
www.doctrine-project.org www.sensiolabs.org
66. Doctrine MongoDB Object Document Manager #sfdaycgn
ā¢ preRemove - The preRemove event occurs for a given document before the
respective DocumentManager remove operation for that document is
executed.
ā¢ postRemove - The postRemove event occurs for an document after the
document has been removed. It will be invoked after the database delete
operations.
ā¢ prePersist - The prePersist event occurs for a given document before the
respective DocumentManager persist operation for that document is executed.
ā¢ postPersist - The postPersist event occurs for an document after the
document has been made persistent. It will be invoked after the database insert
operations. Generated primary key values are available in the postPersist event.
ā¢ preUpdate - The preUpdate event occurs before the database update
operations to document data.
ā¢ postUpdate - The postUpdate event occurs after the database update
operations to document data.
ā¢ postLoad - The postLoad event occurs for an document after the document
has been loaded into the current DocumentManager from the database or after
the refresh operation has been applied to it.
www.doctrine-project.org www.sensiolabs.org
70. Doctrine MongoDB Object Document Manager #sfdaycgn
Initial Document
/**
* @Document
*/
class User
{
/** @Id */
public $id;
/** @String */
public $name;
}
www.doctrine-project.org www.sensiolabs.org
71. Doctrine MongoDB Object Document Manager #sfdaycgn
New Document
/**
* @Document
*/
class User
{
/** @Id */
public $id;
/** @String */
public $firstName;
/** @String */
public $lastName;
}
www.doctrine-project.org www.sensiolabs.org
72. Doctrine MongoDB Object Document Manager #sfdaycgn
Migrate Documents
With Old Field Name
/**
* @Document
* @HasLifecycleCallbacks
*/
class User
{
/** @Id */
public $id;
/** @String */
public $firstName;
/** @String */
public $lastName;
/** @PreLoad */
public function preLoad(array &$data)
{
if (isset($data['name']))
{
$e = explode(' ', $data['name']);
unset($data['name']);
$data['firstName'] = $e[0];
$data['lastName'] = $e[1];
}
}
www.doctrine-project.org www.sensiolabs.org
73. Doctrine MongoDB Object Document Manager #sfdaycgn
Questions?
Jonathan H. Wage
ā¢ http://www.twitter.com/jwage
ā¢ http://www.jwage.com
ā¢ http://www.facebook.com/jwage
You can contact Jonathan about Doctrine and Open-Source or for
training, consulting, application development, or business related
questions at jonathan.wage@sensio.com
www.doctrine-project.org www.sensiolabs.org