Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

facing issues with unique and dropDups

mongoimport -f OR --fieldFile
(18 lines)
replicaSet config
(13 lines)
Feb 8, 2012
Abhishek Kumar
Abhishek Kumar
My db is having a collection having documents like:
{
  _id : ObjectId(.....)
  a : 1,
  b : 2,
  c : [{a1 : 2, a2 : 4}, {a1 : 3, a2 : 1}, {a1 : 6, a2 : 7}]
}

I want to have a unique value for 'c.a1'. My collection design is such
that each time I have to push {a1, a2} pairs in 'c'
To make sure that I have unique value for 'c.a1' I have created
index :
{
		"v" : 1,
		"key" : {
			"c.a1" : 1
		},
		"unique" : true,
		"ns" : "some_db.some_collection",
		"name" : "c.a1_1",
		"dropDups" : true,
		"background" : true
}

but still I am able to insert, same value for 'c.a1' i.e. {a1 : 1,
a2 : 10}, {a1 : 1, a2 : 11} , both are getting inserted ??
Logically the second one should be dropped if first one already
inserted because of unique index on 'c.a1' ?

I am using mongo 2.0.0 version





Reply
Messages in this thread
facing issues with unique and dropDups
reply Re: facing issues with unique and dropDups
(46 lines) Feb 8, 2012 21:01
Facing Issues with RowCounter
November 16, 2011 01:41:57 AM
Hi, I tried to use MR RowCounter to count the rows of a table with specific column family. But it is not displaying correct result. Command (Only Table Name as argument ): Hbase/hbase-0.90.3/bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter…
Facing compilation issues.
November 2, 2011 10:33:42 AM
i downloaded the source and did the following...facing a compliation issue. Anything trivial i am missing here. i have upgraded autoconf and automake to the right versions... 1. ./bootstrap.sh while running ./configure i was facing checking…
Re: Using Dovecot new version 2.0.13 facing issues.
June 9, 2011 12:00:34 AM
> Hi, > > I have configured POP-IMAP server with dovecot 2.0.13 with mysql support. > When I am running load test on the same I face issue on IMAP connections. I > get "dovecot: imap-login: Error: fd_send(imap, 15) failed:…
RE: Facing issues in Import tool
August 31, 2011 01:45:28 AM
Hi Friends I resolved this. Command should be : ./hadoop org.apache.hadoop.hbase.mapreduce.Import list /backup Now it worked and imported my data from /backup to list table. :) From: Stuti Awasthi Sent: Wednesday, August 31, 2011 12:06 PM To:…
Using Dovecot new version 2.0.13 facing issues.
June 3, 2011 12:29:03 PM
Hi, I have configured POP-IMAP server with dovecot 2.0.13 with mysql support. When I am running load test on the same I face issue on IMAP connections. I get "dovecot: imap-login: Error: fd_send(imap, 15) failed: Interrupted system call" followed…
Facing issues in Import tool
August 31, 2011 01:36:26 AM
Hi, I was trying export/import utility but facing some issues while importing. I have 2 cluster of Hbase with Hadoop say A and B. Here what I did : Cluster A: * Created table 'list' in Hbase which is stored in /hbase in Hadoop * …
Facing issues in Riak Deletion process
January 20, 2012 01:31:46 AM
Hi, I am having 100 million keys in a cluster of 4 using bitcask as the storage system and on riak-0.14.2 version. When I deleted around 30 million key then there was no decrease in the memory usage (which was around 9 GB on each 4 nodes). …
Facing issues in rest webservice with Hbase using Ruby
August 25, 2011 04:50:39 AM
Hi friends, I am stuck with my development as I want my ruby client should interact with REST interface to connect to Hbase. To attain this I installed sishen-hbase-ruby gem and hbase-ruby gem on my Ubuntu box. I tried to query a table present in…
MongoDB Replication Set facing some issues like Loss of Data
November 25, 2011 07:09:25 AM
Hello, I am working on a PoC in which we are using MongoDB as our datastore. The solution will be implemented in Java and we are using Spring MongoDB to interact with MongoDB.Currently we are using Spring MongoDB 1.0.0.M5 version which internally…
Perl driver - inserts with dropDups index
November 22, 2010 02:16:34 PM
I'm inserting data into a collection which has an index with dropDups = true. The _id returned from the insert appears to be the value of the dropped doc and not the doc which already exists. Is this intended? Not much value in having a doc id…
Created] (HIVE-2387) Facing issues while executing commands on hive shell. The system throws followi
August 17, 2011 04:51:53 PM
Facing issues while executing commands on hive shell. The system throws following error
Created] (HIVE-2388) Facing issues while executing commands on hive shell. The system throws followi
August 17, 2011 04:54:12 PM
Facing issues while executing commands on hive shell. The system throws following error: only on Windows Cygwin setup
Created: (DERBY-5111) NullPointerException on unique constraint violation with unique index
March 8, 2011 02:17:22 PM
NullPointerException on unique constraint violation with unique index
Is there an efficient way to insert unique rows (UNIQUE(a, b, c)) into an fts3 virtual table?
October 5, 2011 07:25:56 AM
Hi! Haven't been able to find a solution reading sqlite-users mailing list, http://www.sqlite.org/, nor googling at large. I need to insert rows with a unique column combination into a fts3 virtual table. http://www.sqlite.org/fts3.html states: …
Changing an existing non unique shard key index to unique
December 13, 2011 07:23:48 PM
Hey, I need to make an existing index: { "v" : 1, "key" : { "hashed_device_id" : 1 }, "ns" : "crittercism.user", "name" : "hashed_device_id_1", "background" : true }, into a unique index. The problem is, that this index is also…
Unique index versus unique constraint
March 18, 2011 04:59:06 AM
Hi All, When I create a table and specify a unique constraint, a unique index is automatically created. This index cannot be dropped, so the only way to get rid of the uniqueness is to recreate the table without the constraint. No problem. When I…
Re: Is Map/Reduce appropriate for consolidating non-unique keys to unique ones?
March 1, 2011 09:05:21 PM
On Tue, Mar 1, 2011 at 6:49 PM, Adam Fields <fie### @street86.com> wrote: > > On Mar 1, 2011, at 8:59 PM, Scott Hernandez wrote: > >> I don't think map/reduce is what you want for this. Map/reduce results >> in a new…
Is Map/Reduce appropriate for consolidating non-unique keys to unique ones?
March 1, 2011 07:12:26 PM
I have a bunch of items in a collection, of the form: {a:<integer>, b:<string>, c:<datetime>, d:<datetime>, ... and then a whole bunch of other arbitrary value pairs which differ for each item } I have a unique key on "b"…
Facing problem to add UDF
August 9, 2010 09:13:11 AM
Hi, I am trying UDF Lower example. I added Lower.jar, I am still getting error. Can some help me? when I execute following statement:- create temporary function my_lower as 'com.example.hive.udf.Lower'; I get following error. FAILED: Execution…
Problem facing in Mongo DB
January 31, 2011 02:58:27 AM
Hi folks, i have a problem that i reached the 2 GB data on my 32 bit system. is there any way that i can store more then that of 2 GB. if so please let me know. i done some search also but i haven't found any solution related to that other then…
Facing a problem with sqlite prepare statement
April 7, 2011
Hi, i am creating an sqlite incorporated application in iphone. i have all the neccasary steps to open the database,insert data into database and…
Good Firewalling practice for internet facing servers?
May 21, 2011
Does it make sense to firewall an internet facing server, say a webserver? Assuming I did not want to restrict anyone from accessing the webserver…
IPhone SQLite Encryption With SQLCipher Facing Errors
February 16, 2011
Hello Everyone, I am trying to learn about the encryption of DB at application level using this tutorial . But I am getting an error that says…
Facing problem accessing MySql Timestamp column in Entity Framework
June 1, 2011
Hi, I am using MySql .net connector 6.3.6 and Visual Studio 2008 sp1. One of the table in the database has a timestamp column. When I generate…
On a Nexus S, how do I activate the front facing camera in a Fring video call?
December 16, 2010
video calling in Fring is working but the video is only showing the rear-facing camera, how do activate the front-facing camera?
Drupal migration :: Routing/dispatching issues or permission issues?
April 18, 2011
I have a multi site drupal installation that I am having issues with on 'the new server'. I can get it to work perfect on my dev system. On the dev…
Mysql : how to create custom unique key combination based on year and a unique no.
December 28, 2010
Hi, Ok, let me explain the scenario. I have a "orders" table with a auto incr key "orderno" in it. The table has a field "orderdate" also. What I…
MySQL: How to alter varchar(255) UNIQUE column to UNIQUE Text NOT NULL ?
January 20, 2011
The current column is a VARCHAR(255) NOT NULL, so how do I change it to TEXT NOT NULL? NOTE: The column intended to be changed its property type is…
Unique code based on unique email address in mysql table?
March 14, 2011
I have a mysql table which will store users email addresses (each is unique and is the primary field) and a timestamp. I have added another column…
MySQL. Primary key in a relational table. Unique id or multiple unique key?
June 16, 2011
Primary key in relational tables. Composite primary key or unique primary key in those pure relational tables? Which design would you recommend to…
Fetch views by (unique viewers and unique videos)
January 12, 2011
This is little bit complicated SQL query wich needs to fetch all the views by unique viewers and unique videos, Because multiple views of the same…
Why do I have non-unique entries against a unique index? (PostgreSQL 9.0)
February 15, 2011
I have a unique index in my postgresql 9.0 db, based on a function. I have yet to make it fail with any manual tests I try, but I am seeing some…
"Unique" column in MySQL not very unique (has duplicates)
January 13, 2011
I'm a bit confused by MySQL unique columns. I have a MySQL table that looks something like user_id (unsigned int), user_password(char 16), user_ip…
Multiple unique columns but only unique combinations
May 12, 2011
Hey all I've run into a problem with MySQL unique indicies. What I want to do is have something like this: user_id group_id 1 1 1 2 1 3 2 1 2 4…
Is there any way to create a "signature" of a string to make sure that a string is unique? Or should I use unique DB index?
March 23, 2011
I'm building a website. Users can submit "Title" which is a string of unicode characters (not just English). When a user submit a "Title", I want to…
How to get a unique comma separated string from a non-unique string in php
February 24, 2011
i have a php string $select_columms = 'pid, p.title, caption, filepath, filename, encaption, user1, user2, user3, user4, user5, user6, ult_puja,…
Issues with WHERE AND
March 27, 2011
I am currently trying to do search for rows that match two fields with variables, like this: <?php $result = mysql_query("SELECT * FROM table…
Can anyone help me with 2 issues?
February 5, 2011
Hi all, I will try to explain things as clearly as I can. Is there a better way of doing this query? SELECT forum_id, forum_name, forum_description,…
SQLite issues with iOS?
April 25, 2011
I have an iPhone app that stores information to a SQLite database. It works splendid on my phone as well as my brothers. Stuff get's written to it…
DNS issues on my iPhone
February 27, 2011
I'm trying to call up "https://m.google.com" on my iPhone on my home WiFi. It's saying Safari "cannot verify server identity" of m.google.com, then…