Git Product home page Git Product logo

bongo's People

Contributors

ilijamt avatar jraede avatar msolimans avatar securingsincity avatar thehippo avatar zeozorg 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

bongo's Issues

No Update() method?

Hello everyone,

I'm looking to do a partial update on a document (as described in the mongo docs) but it seems this ODM doesn't support it. The save() method will wholesale rewrite a document with a given object - if any fields are omitted, they will be removed.

Any reason why this was omitted? If there's not a blocking issue, I could possible contribute and add this functionality in a PR.

Regards,

William

mongodb3.0 SCRAM-SHA-1?

Database connection error: %v server returned error on SASL authentication step: Authentication failed.

Should Clone() replace with Copy() ?

var err error
sess := c.Connection.Session.Clone()       // if  mongo cluster has a failover, sess socket may be closed,  **Should Clone() replace with Copy()** ?
                                                                     //otherwise I  have to call sess.Refresh()
defer sess.Close()

README connection example results in compiler error

The line

connection := bongo.Connect(config)

does not assign the returned error variable to anything.
Maybe change it to

connection, err := bongo.Connect(config)
if err != nil {
    panic(err)
}

and let the user decide if they want to just ignore the error with _?

Project status?

Just asking. Last commit was on October. Do you have a feature roadmap or the main focus is stability, like mgo?

Best regards and congratz for your awesome work.

Error while creating a collection

On running the command

err := connection.Collection("people").Save(myPerson)

I'm experiencing this error

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1284525]

goroutine 1 [running]:
main.main()
	/Users/radhakotecha/Desktop/learning/golang/Mongo Connection/Backend/main.go:88 +0x3b5
exit status 2

Collection.Save CascadeSave bug

Collection.Save(document) method invoke "CascadeSave" using goRoutine.
when i change document's field 10 times and save every times.
the function CascadeSave will invoke 10 times use 10 Routines;
the 10 Routines will not ordered, some Routines will concurrency, then parent doc error

A reflection error when trying to set values on a pointer struct

reflect: call of reflect.Value.FieldByName on zero Value when trying to save a value on a struct that is a pointer for example:

type BandsByRole struct {
    Foo     *Wrapper `bson:"foo"`
    Default *Wrapper `bson:"default"
}

type Wrapper struct {
  Bar BoolWrapper `bson: "bar"`
}

type BoolWrapper struct {
  Baz bool `bson:"baz"`
}

saving foo.bar.baz = true will throw the error

How to Modify Element

Hi
now in bongo there is 3 operations insert , delete and find
what if i need to modify exciting element what i should do

make Delete functions like Find functions

It would be awesome if Delete would be called DeleteOne like the FindOne method.
Additionally I would love the support for complex delete queries, again, like Find.

Not sure what "Cascading" does?

hey guys.

Sorry for the noob question, but I couldn't understand what "cascade" actually means in this sentence:

you can cascade a player's first name and last name to his or her team.Players array on save, and remove that element in the array if you delete the player.

Supposing I have the following "team", in what could cascade help-me?

[
	{
		"team": "Team A",
		"players": [
			{
				"firstname": "Player",
				"lastname": "1"
			},
			{
				"firstname": "Player",
				"lastname": "2"
			},
			{
				"firstname": "Player",
				"lastname": "3"
			}
		]
	}
]

questions

Hello, I have not found any other ODM for MongoDB and Go.
So I am asking because I have no other choice on what to chose.

How to set a filed as unique?
How to use the foreign keys?

Best way to check if exist with some conditions

Hello guys

I want to make an endpoint in my application to check if a slug already exists
I made in this way:

connection := storage.DbBongo()
connection.Collection("mycollection").FindOne(bson.M{"slug": slug}, &post)

isAvailable := post.Id == ""
/// RESPONSE IF IS AVAILABLE AFTER

But, in this query to MongoDb I'm getting all post data
I want to make a simple query getting only if exist or not

To simplify, I want to count

Like this:

isAvailable := connection.Collection("communities").Find(bson.M{"slug": slug}).Count() == 0

How can I do this?

Thanks

Indexes?

How would I go about creating indexes with Bongo? I have several collections that will require unique indexes, and would love to use Bongo for modeling. (I assume once I have the constraints set up, I'll be able to parse any validation errors, including unique constraint errors, during the middleware hooks – correct?)

The FindOne example in README is incorrect.

In README document:
err := connection.Collection("people").FindOne(bson.M{"firstName":"Bob"})

Should be:
err := connection.Collection("people").FindOne(bson.M{"firstName":"Bob"}, person)

Populate sintax

Hi guys thanks for this project, it is amazing.

My Question is I can populate a child collection when the parent document has only ObjectId for relation.

Somthing like this:

type User struct {
...
Address bson.ObjectId `bson:"address"`
}

connection.Collection("user").Find(bson.M{"firstName":"Bob"}).Populate("messages")

Best regards.

Repository 'go-dotaccess' not found while installing

When I try to import the library, I get error about missing dependency which is not present on GitHub:

go get github.com/maxwellhealth/bongo
cd .; git clone https://github.com/maxwellhealth/go-dotaccess /Users/user/go/src/github.com/maxwellhealth/go-dotaccess
Cloning into '/Users/user/go/src/github.com/maxwellhealth/go-dotaccess'...
remote: Repository not found.
fatal: repository 'https://github.com/maxwellhealth/go-dotaccess/' not found
package github.com/maxwellhealth/go-dotaccess: exit status 128

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.