ArchiveOrangemail archive

Commits to the Bucardo project


bucardo-commits.bucardo.org
(List home) (Recent threads) (5 other Bucardo lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Low traffic list: less than 3 messages per day
  • This list contains about 1,675 messages, beginning Sep 2007
  • 0 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

master/b73ef71 Do not map NULL values to Mongo but simply drop them, as MongoDB is schemaless.

Ad
(Greg Sabino Mullane)1335795370Mon, 30 Apr 2012 14:16:10 +0000 (UTC)
The branch, master has been updated


- Log -----------------------------------------------------------------
commit b73ef71535c64a8a0afeef91554c1474d82c3d1b
Author: Ali Asad Lotia 
Date:   Mon Apr 30 10:12:02 2012 -0400

    Do not map NULL values to Mongo but simply drop them, as MongoDB is schemaless.

diff --git a/Bucardo.pm b/Bucardo.pm
index 02f39ef..3222518 100644
--- a/Bucardo.pm
+++ b/Bucardo.pm
@@ -8526,7 +8526,11 @@ sub push_rows {
                         }
                         ## Coerce non-strings into different objects
                         for my $key (keys %$object) {
-                            if ($goat->{columnhash}{$key}{ftype} =~ /smallint|integer|bigint/o) {
+                            ## Since mongo is schemaless, don't set null columns in the mongo doc
+                            if (!defined($object->{$key})) {
+                                delete $object->{$key};
+                            }
+                            elsif ($goat->{columnhash}{$key}{ftype} =~ /smallint|integer|bigint/o) {
                                 $object->{$key} = int $object->{$key};
                             }
                             elsif ($goat->{columnhash}{$key}{ftype} eq 'boolean') {-----------------------------------------------------------------------

Summary of changes:
 Bucardo.pm |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Home | About | Privacy