Giter VIP home page Giter VIP logo

fluent-mongo-driver's Introduction

Vapor

Documentation Team Chat MIT License Continuous Integration Code Coverage Swift 5.7+ Mastodon


Vapor is an HTTP web framework for Swift. It provides a beautifully expressive and easy-to-use foundation for your next website, API, or cloud project.

Take a look at some of the awesome stuff created with Vapor.

💧 Community

Join the welcoming community of fellow Vapor developers on Discord.

🚀 Contributing

To contribute a feature or idea to Vapor, create an issue explaining your idea or bring it up on Discord.

If you find a bug, please create an issue.

If you find a security vulnerability, please contact [email protected] as soon as possible.

💛 Sponsors

Support Vapor's development by becoming a sponsor.

Broken Hands Emerge Tools Jari Donut Dane MacStadium

💚 Backers

Support Vapor's development by becoming a backer.

Moritz LangMaarten EngelsThomas KrajacicJesse TiptonSteve HumeMikkel UlstrupGeoffrey FosterPaul SchmiedmayerScott RobbinsSven A. SchmidtSpencer CurtisZach RausnitzTim „Timinator“ KretzschmarKlaasAndrew Edwards+Li, Inc.Stijn WillemsKyle NewsomeVia Aurelia SolutionsJakub KiermaszBrian DrellingMattes MohrJamieGalen RhodesLitmapsDavid RomanBrian StrobachKishikawa KatsumiAlex SherbakovSidetrackGreg KarpatiFrantišek MikšJeremy GreenwoodRay FixMićo MiloložaAlanJonas SannewaldTapEnvy.us, LLCJawadPARAIPAN SORINKalyn DavisYR ChenAarón Martínez Cuevas

fluent-mongo-driver's People

Contributors

0xtim avatar bennydebock avatar calebkleveter avatar gwynne avatar jaapwijnen avatar joannis avatar mfranceschi6 avatar qi-shun-wang avatar stefanodevuono avatar tanner0101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fluent-mongo-driver's Issues

MongoDB driver taking extremely long to query

I am working on a Vapor REST API with a MongoDB instance as Database. We already created most of this API in NodeJS but for reasons I won't go into now we want to rewrite the codebase in Swift/Vapor.

We created a few models and controllers and we just got things set up.
Now here's the problem:

It looks like the MongoDB connection is not working as expected. When doing a HTTP request the MongoDB query takes about a minute to return a result. The thing is, we are using the same MongoDB as with the NodeJS API and there the response was instant.

Steps to reproduce

To reproduce just setup a Vapor app with MongoDB driver.
Also set up a MongoDB instance. I set up mine in Docker.
I tried running with both Xcode and the Vapor CLI

Group.swift

import Fluent
import Vapor

final class Group: Model, Content {
    
    static let schema = "groups"
    
    @ID(key: .id) var id: UUID?
    @Field(key: "group_code") var code: String
    @Field(key: "group_name") var name: String
    
    init() { }
    
    init(id: UUID? = nil, code: String, name: String) {
        self.id = id
        self.code = code
        self.name = name
    }
    
}

Environment

  • Vapor Framework version: 4.0.0 and/or 4.35.0
  • Vapor Toolbox version: stable 18.2.2 (bottled)
  • Vapor Fluent version: 4.0.0
  • Vapor Fluent MongoDB Driver version: 1.0.2
  • Swift version: 5.3
  • Build configuration: Debug
  • OS version: macOS 14.0.1 RC

Add support for MongoDB $text indexes

MongoDB text indexes can function as a simplified text search engine. It functions as a "good enough" solution that can understand the complexity of many languages.

Adding support for $text index creation would also need the addition of a text search API.

FluentMongoError is not public

Is your feature request related to a problem? Please describe.
I can't handle FluentMongoErrors thrown by this package

Describe the solution you'd like
Make FluentMongoError public

Describe alternatives you've considered
I don't think it applies

Additional context
Would be nice to be able to handle errors

Fix CI

We shouldn't be testing nightlies, just 5.2 and latest supported unless there are any language checks in the repo. See CI failures in #43

Cannot build or test

edit: It looks like the tn-field-key branch on fluent-kit was merged into tn-beta-5. I can make a PR to update to that.

edit again: PR is up

I'm new to vapor and eager to help out. I just saw this get repo today and thought I'd dl it and poke around. So far, running Catalina, when I run vapor build or vapor test, I get:

~/D/fluent-mongo-driver (master|✔) $ vapor test
Testing [Failed]

Log:
https://github.com/vapor/fluent-kit.git @ tn-field-key: error: terminated(128): git -C /Users/stefanodevuono/Documents/fluent-mongo-driver/.build/repositories/fluent-kit-44c6ebdc rev-parse --verify 'tn-field-key^{commit}' output:
    fatal: Needed a single revision
    


Output:
Fetching https://github.com/vapor/fluent-kit.git
Fetching https://github.com/OpenKitten/MongoKitten.git


Help:
Join our Slack where hundreds of contributors
are waiting to help: http://vapor.team

Error: Tests failed.
~/D/fluent-mongo-driver (master|✔) $ vapor build
Building Project [Failed]

Command:
build

Error (1):
https://github.com/vapor/fluent-kit.git @ tn-field-key: error: terminated(128): git -C /Users/stefanodevuono/Documents/fluent-mongo-driver/.build/repositories/fluent-kit-44c6ebdc rev-parse --verify 'tn-field-key^{commit}' output:
    fatal: Needed a single revision
    


Output:
Updating https://github.com/OpenKitten/MongoKitten.git
Updating https://github.com/vapor/fluent-kit.git


Toolchain:
/usr/bin/swift

Help:
Join our Slack where hundreds of contributors
are waiting to help: http://vapor.team

Error: Build failed.

When I open the project in Xcode, I see the following error:

The repository could not be found. Make sure a valid repository exists at the specified location and try again.

I'm happy to write some documentation and submit a PR for that if anyone can help point me in the right direction. And also happy to contribute to building out some more functionality.

TTL index

Hello! How can I create TTL index if I use this library??

Issues connecting to CosmosDB

Hello, I'm having trouble connecting my app to an Azure CosmosDB.
I can't share the exact connection string since it's my employer's, but here's a redacted version:

mongodb://{username}:{password}@{host}:{port}/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@{appName}@

Using this approach doesn't work at all:

try app.databases.use(.mongo(connectionString: "mongodb://{username}:{password}@{host}:{port}/?ssl=true"), as: .mongo)

When I try to use this I get the following errors:

[ ERROR ] Couldn't find or create a connection to MongoDB with the requested specification
[ ERROR ] Couldn't find or create a connection to MongoDB with the requested specification
[ WARNING ] No hosts could be connected with, therefore no queries can be sent at the moment: The connection string could not be used to connect to a host
Solution(s):
- Check if your hosts are online, not undergoing maintenance
- Check your connection strings for any errors in configuration
- Check if your server is whitelisted when using MongoDB atlas
- If using MongoDB atlas, make sure you're connecting with SRV

Could someone tell me what's going on there?

I tested the connection string in the mongo shell, where it worked fine. I also tried using MongoKitten, where it didn't work. But using the official Mongo Swift Driver works fine as well.

Thanks in advance for any help.

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.