FAQ
Hi,
I try to learn go and for my experience to port nodejs little project to go.
I must insert/update data into my mongodb, simple document structure works
well.
But I have a more sophistical document structure like this :

{
   "_id": "20130526-6000-19",
   "answere_wait_time": NumberInt(0),
   "call_daily": NumberInt(5),
   "call_hourly": {
     "1": NumberInt(5)
   },
   "call_minute": {
     "1": {
       "34": NumberInt(1),
       "41": NumberInt(2),
       "42": NumberInt(1),
       "44": NumberInt(1)
     }
   }
   },
   "metadata": {
     "user": "6000",
     "dt": ISODate("2013-05-26T03:00:00.0Z"),
     "disposition": NumberInt(19)
   }
}

What is right/smart way to represent my upsert in golang ?
Thank for help

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Matt Joiner at Sep 30, 2013 at 4:18 am
    Have you looked at http://labix.org/mgo ?
    On Sunday, September 29, 2013 9:36:35 PM UTC+10, v.gont...@gmail.com wrote:

    Hi,
    I try to learn go and for my experience to port nodejs little project to
    go.
    I must insert/update data into my mongodb, simple document structure works
    well.
    But I have a more sophistical document structure like this :

    {
    "_id": "20130526-6000-19",
    "answere_wait_time": NumberInt(0),
    "call_daily": NumberInt(5),
    "call_hourly": {
    "1": NumberInt(5)
    },
    "call_minute": {
    "1": {
    "34": NumberInt(1),
    "41": NumberInt(2),
    "42": NumberInt(1),
    "44": NumberInt(1)
    }
    }
    },
    "metadata": {
    "user": "6000",
    "dt": ISODate("2013-05-26T03:00:00.0Z"),
    "disposition": NumberInt(19)
    }
    }

    What is right/smart way to represent my upsert in golang ?
    Thank for help
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Felix Zilla at Oct 1, 2013 at 1:25 pm
    http://godoc.org/labix.org/v2/mgo#Collection.Upsert

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 29, '13 at 5:01p
activeOct 1, '13 at 1:25p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase