简体   繁体   English

错误:doctrine.mongodb:generate:document没有找到与Symfony3捆绑在一起的捆绑包

[英]Error: doctrine.mongodb:generate:document No bundle Bundle was found with Symfony3

Error: doctrine.mongodb:generate:document No bundle Bundle was found with Symfony3. 错误: doctrine.mongodb:generate:document与Symfony3找不到捆绑包。

c:\\Bitnami\\wampstack-5.6.20-0\\apache2\\htdocs\\sym\\patmonS1> php bin/console doctrine:mongodb:generate:document PatmonBundle:Product c:\\ Bitnami \\ wampstack-5.6.20-0 \\ apache2 \\ htdocs \\ sym \\ patmonS1> php bin/console doctrine:mongodb:generate:document PatmonBundle:Product

PHP Warning:  Module 'mongo' already loaded in Unknown on line 0
  [Symfony\Component\Console\Exception\RuntimeException]
  The "--filter" option does not exist.

config.tml config.tml

doctrine_mongodb:
    connections:
        default:
            server: "%mongodb_server%"
            options: {}
    default_database: hello_%kernel.environment%
    document_managers:
        default:
            mappings:
                PatmonBundle: ~
            #filters:
            #    filter-name:
            #        class: Class\Example\Filter\ODM\ExampleFilter
            #        enabled: true
            metadata_cache_driver: array # array, apc, xcache, memcache

C:\\Bitnami\\wampstack-5.6.20-0\\apache2\\htdocs\\sym\\patmonS1\\app\\config\\services.yml services: C:\\ Bitnami \\ wampstack-5.6.20-0 \\ apache2 \\ htdocs \\ sym \\ patmonS1 \\ app \\ config \\ services.yml服务:

mongo_client:
    class: MongoClient
    # if using a username and password
    arguments: ['mongodb://%mongodb_username%:%mongodb_password%@%mongodb_host%:27017']

session.handler.mongo:
    class: Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler
    arguments: ['@mongo_client', '%mongo.session.options%']

C:\\Bitnami\\wampstack-5.6.20-0\\apache2\\htdocs\\sym\\patmonS1\\app\\config\\parameters.yml C:\\ Bitnami \\ wampstack-5.6.20-0 \\ apache2 \\ htdocs \\ sym \\ patmonS1 \\ app \\ config \\ parameters.yml

parameters:
    mongodb_server: mongodb://localhost:27017
    mongodb_username: username
    mongodb_password: password
    mongodb_host: localhost
    mongo.session.options:
        db_name: mdb_patmonS1
        collection: session

C:\\Bitnami\\wampstack-5.6.20-0\\apache2\\htdocs\\sym\\patmonS1\\src\\Pat\\monBundle\\Document\\Product.php C:\\ Bitnami \\ wampstack-5.6.20-0 \\ apache2 \\ htdocs \\ sym \\ patmonS1 \\ src \\ Pat \\ monBundle \\ Document \\ Product.php

<?php

namespace Pat\monBundle\Document;

// http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
// http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html#cookbook-mongodb-field-types
// http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/basic-mapping.html

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
//use Doctrine\ODM\MongoDB\Mapping\Annotations\Document; with annotation @Document

/**
 * @MongoDB\Document
 */
class Product
{
    /**
     * @MongoDB\Id
     */
    protected $id;

    /**
     * @MongoDB\Field(type="string")
     */
    protected $name;

    /**
     * @MongoDB\Field(type="float")
     */
    protected $price;
}

Just realized, that such a command does not exist in mongodb. 刚刚意识到,在mongodb中不存在这样的命令。 I am new with mongodb. 我是mongodb的新手。 Nevertheless, exists command: 但是,存在命令:

php bin/console doctrine:mongodb:generate:documents PatmonBundle php bin /控制台学说:mongodb:generate:documents PatmonBundle

http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Symfony3 / Doctrine MongoDB ODM:捆绑包/文档之外的其他文件夹? - Symfony3 / Doctrine MongoDB ODM: other folder than Bundle/Documents? 主义(Symfony3)可捕获的致命错误:传递给(bundle)的参数1必须是(bundle)的实例,给定数组 - Doctrine (Symfony3) Catchable Fatal Error: Argument 1 passed to (bundle) must be an instance of (bundle), array given Symfony3错误添加新捆绑 - Symfony3 error adding new bundle 带有Symfony致命错误的PHPUnit:找不到类&#39;Doctrine \\ Bundle \\ DoctrineBundle \\ DoctrineBundle&#39; - PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found Sylius (Symfony3) 时事通讯包? - Newsletter bundle for Sylius (Symfony3)? Symfony3 捆绑包与 FOSUserBundle 冲突 - Symfony3 bundle conflicts with FOSUserBundle Symfony2 - doctrine:generate:entity throws&#39;Bundle“AcmeBlogBu​​ndle”不存在&#39;错误 - Symfony2 - doctrine:generate:entity throws 'Bundle “AcmeBlogBundle” does not exist' error Symfony3 / Doctrine 2刷新错误 - Symfony3 / Doctrine 2 flush error Symfony2 / Doctrine2:生成捆绑包外的实体 - Symfony2/Doctrine2: Generate entities that are outside a bundle Symfony3-在src / bundle外部定义服务 - Symfony3 - Define service outside src/bundle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM