Source

						public function testMongoIdPreservation() {
		$model = $this->_model;
		$model::config(array('connection' => 'lithium_mongo_test', 'source' => 'ordered_docs'));

		$post = $model::create(array('title' => 'A post'));
		$post->save();
		$id = $post->_id;

		$data = Connections::get('lithium_mongo_test')->connection->ordered_docs->findOne(array(
			'_id' => $id
		));
		$this->assertEqual('A post', $data['title']);
		$this->assertEqual($id, (string) $data['_id']);
		$this->assertTrue($data['_id'] instanceof MongoId);

		$post->title = 'An updated post';
		$post->save();

		$data = Connections::get('lithium_mongo_test')->connection->ordered_docs->findOne(array(
			'_id' => new MongoId($id)
		));
		$this->assertEqual('An updated post', $data['title']);
		$this->assertEqual($id, (string) $data['_id']);
	}