Git Product home page Git Product logo

Comments (8)

Reasno avatar Reasno commented on September 4, 2024

example没有更新到2.2.0版本,可以看一下https://github.com/hyperf/gotask/blob/master/tests/Cases/MongoDBTest.php 这里的用法。

from gotask.

leinZero avatar leinZero commented on September 4, 2024

用的2.2版,问题依旧

from gotask.

Reasno avatar Reasno commented on September 4, 2024

用的2.2版,问题依旧

是example里给的使用方式不是最新的。现在已经更新了。

from gotask.

leinZero avatar leinZero commented on September 4, 2024

$client = make(MongoClient::class);
$collection = $client->database('test')->collection('test');
$result = $collection->find(['user_id' => 0], ['skip' => 0, 'limit' => 1]);
print_r($result);

from gotask.

leinZero avatar leinZero commented on September 4, 2024

用的是MongoClient这个类

from gotask.

leinZero avatar leinZero commented on September 4, 2024

貌似是因为mongo加了用户密码认证就不行了:mongodb://ssaa:[email protected]:27017

from gotask.

Reasno avatar Reasno commented on September 4, 2024

了用户

用户名密码要在config里配置呀

from gotask.

Reasno avatar Reasno commented on September 4, 2024

这里有一个hyperf下使用的demo: https://github.com/reasno/fastmongo

from gotask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.