【问题标题】:How to start work MongoDB with php kohana framework如何使用 php kohana 框架开始工作 MongoDB
【发布时间】:2016-05-17 23:15:29
【问题描述】:

我目前正在使用 MongoDB 使用 php Kohana 框架开发应用程序。我有这个 link 用于适用于这个框架的 MongoDB 模块。按照给出的说明,我已经用应用程序配置了模块。但我坚持在这里无法进行进一步的开发工作。基于 MongoDB 的查询不能与此模块一起使用。在从集合中选择单个文档时,按照代码向我发送错误。

 <?php defined('SYSPATH') OR die('No Direct Script Access');
    Class Model_Cms extends Model
    {
        public function __construct()
        {
            $this->mongo_db = MangoDB::instance('default');
        }

        /*Get the CMS Content*/
        public function getcmscontent($content,$default_companyid="")
        {
          $cms_result = $this->mongo_db->findOne('cms');
            return $cms_result;
        }
    }

任何人都可以帮助我进一步进行。

【问题讨论】:

  • MangoDB 是错字吗?
  • @AlessandroDaRugna,是的
  • 投票结束问题,因为问题的原因是一个简单的错字。 @AlessandroDaRugna 不错的地方,顺便说一句。

标签: php mongodb kohana-mangodb


【解决方案1】:
$cms_result = $this->mongo_db->find_one(MDB_CMS,array('type'=>1,'status'=>1,'menulinks.menu_link'=>$content),array('content','meta_keyword','meta_title','meta_description','menu'));

在这个问题上花费了几个小时后,我已经使用了这种方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    • 2011-02-16
    相关资源
    最近更新 更多