Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Retrieving a Subset of Fields
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Xiao Yunting  
View profile  
 More options Aug 1 2012, 2:37 pm
From: Xiao Yunting <yunting.x...@gmail.com>
Date: Wed, 1 Aug 2012 14:37:54 -0400
Local: Wed, Aug 1 2012 2:37 pm
Subject: Retrieving a Subset of Fields

Hi there,

I set up a collection structure as follows (this is one document in the collection):

{
        _id: ddd
        value_set:
        [
                {
                        key_t : 1
                        value_t : aaa
                },

                {
                        key_t : 2
                        value_t : bbb
                },
                {
                        key_t : 3
                        value_t : ccc
                },
                ....

        ]

}

....

My question is that whether there is a way to get one specific value_t by specifying the _id and value_set.key_t. Such as xxx.find({_id : ddd, value_set.key_t: 2},{value_set.value_t:1}), and then I can get "bbb" as result?

Thanks in advance,
Yunting


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergei Tulentsev  
View profile  
 More options Aug 1 2012, 3:35 pm
From: Sergei Tulentsev <sergei.tulent...@gmail.com>
Date: Wed, 1 Aug 2012 23:35:05 +0400
Local: Wed, Aug 1 2012 3:35 pm
Subject: Re: [mongodb-user] Retrieving a Subset of Fields

Yes, you can retrieve a subset of fields using the syntax you mentioned.
However, you're asking for a bit more. You're asking how to retrieve a
value of a field of an element of an array, which is something you can't do
at the moment.

On Wed, Aug 1, 2012 at 10:37 PM, Xiao Yunting <yunting.x...@gmail.com>wrote:

--
Best regards,
Sergei Tulentsev

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jenna  
View profile  
 More options Aug 1 2012, 4:06 pm
From: Jenna <jenna.deboisbl...@10gen.com>
Date: Wed, 1 Aug 2012 13:06:43 -0700 (PDT)
Local: Wed, Aug 1 2012 4:06 pm
Subject: Re: Retrieving a Subset of Fields
In MongoDB version 2.2 (the next stable release), it will be possible
to use the positional operator to return specific embedded documents
in an array:
https://jira.mongodb.org/browse/SERVER-828

Here is an example from MongoDB 2.2 rc-0 (development release):

sample doc:
{_id: 1, array: [ {id : 507, name: "Jenna"}, {id: 506, name :
"Matt" } ] }

query:
db.collection.find({_id:1, "array.id":506},{_id:0, "array.$":1})

result:
{ "array" : [ { "id" : 506, "name" : "Matt" } ] }

Information on the positional operator:
http://www.mongodb.org/display/DOCS/Updating/#Updating-The%24position...

On Aug 1, 3:35 pm, Sergei Tulentsev <sergei.tulent...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xiao Yunting  
View profile  
 More options Aug 1 2012, 3:38 pm
From: Xiao Yunting <yunting.x...@gmail.com>
Date: Wed, 1 Aug 2012 15:38:03 -0400
Local: Wed, Aug 1 2012 3:38 pm
Subject: Re: [mongodb-user] Retrieving a Subset of Fields

Thanks a lot anyway~
Best,
Yunting

On Aug 1, 2012, at 3:35 PM, Sergei Tulentsev wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Encrypting Mongo document contents" by Russell Bateman
Russell Bateman  
View profile  
 More options Aug 1 2012, 8:23 pm
From: Russell Bateman <r...@windofkeltia.com>
Date: Wed, 01 Aug 2012 18:23:32 -0600
Local: Wed, Aug 1 2012 8:23 pm
Subject: Encrypting Mongo document contents

According to /Payment Card Industry (PCI) Requirements and Security
Assessment Procedures/, I must attempt to encrypt much of the credit-
and debit card data I keep on hand for my customers.

Does anyone have experience doing that? I have encryption and could
encrypt either the document as just an ugly chunk with an _id or I could
do it field by field.

The problem I see is that as soon as I do that, I'm unable to search for
any such payment options (cards) by any field I've encrypted or at all
if I've encrypted the whole document contents.

Any wisdom and suggestions are heartily welcomed.

Russ


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jenna  
View profile  
 More options Aug 6 2012, 12:49 pm
From: Jenna <jenna.deboisbl...@10gen.com>
Date: Mon, 6 Aug 2012 09:49:00 -0700 (PDT)
Subject: Re: Encrypting Mongo document contents
Hello Russ,
Here is a Stackoverflow response that you may find helpful:
http://stackoverflow.com/questions/8803332/mongodb-database-encryption

It sounds like you've correctly identified the problem associated with
total document encryption. If you would like to use the database to
perform queries on the data, you should only encrypt fields with
sensitive information.

On an unrelated note, for future questions, it'd be great if you could
start a new thread when discussing new topics.

On Aug 1, 8:23 pm, Russell Bateman <r...@windofkeltia.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Russell Bateman  
View profile  
 More options Aug 7 2012, 10:48 am
From: Russell Bateman <r...@windofkeltia.com>
Date: Tue, 07 Aug 2012 08:48:56 -0600
Local: Tues, Aug 7 2012 10:48 am
Subject: Re: [mongodb-user] Re: Encrypting Mongo document contents
Jenna,

Thanks for your response.

Ooh, okay. I may be screwing up all my correspondence then. I'm pretty
certain I started a new thread. I blind-copied myself so I'd see what I
wrote and as I inspect what came to me, the blind copy appears identical
to any other except that it doesn't have "[mongodb-user]" in the title.
I wasn't sure I was supposed to put that on or let the list take care of
that.  My subject was "Encrypting Mongo document contents", no "Re:
anything" or the "[]" tag and I addressed it to
mongodb-user@googlegroups.com. What am I missing? What constitutes a new
or old thread anyway? Is there a link to the procedure I should be
paying attention to?

Regrets,

Russ

On 8/6/2012 10:49 AM, Jenna wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Hernandez  
View profile  
 More options Aug 7 2012, 11:27 am
From: Scott Hernandez <scotthernan...@gmail.com>
Date: Tue, 7 Aug 2012 11:27:32 -0400
Local: Tues, Aug 7 2012 11:27 am
Subject: Re: [mongodb-user] Re: Encrypting Mongo document contents
Russell, if you are just doing equality matching on your queries then
you can store encrypted values and encrypt the values to search with,
but this will not work on range queries as Kyle states in the
stack-overflow response.

Here is the source of your email, and you will note that is has fields
linking it into a thread from a previous post:
https://groups.google.com/group/mongodb-user/msg/313d177e6fe7a2bb?dmo...

You can see the nesting behavior here, and the change of subject lines
as well: https://groups.google.com/group/mongodb-user/browse_thread/thread/93a...

Please just create a new message/post and don't start from an existing one.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Russell Bateman  
View profile  
 More options Aug 7 2012, 11:31 am
From: Russell Bateman <r...@windofkeltia.com>
Date: Tue, 07 Aug 2012 09:31:05 -0600
Local: Tues, Aug 7 2012 11:31 am
Subject: Re: [mongodb-user] Re: Encrypting Mongo document contents
Ah, okay, I see what I did. I pirated an existing mail by doing a reply
to list, then cleared everything out. I use Thunderbird and not Google
to view these threads, so I had no idea what I was doing wrong. Thanks,
Scott and Jenna. I'll repent of this evil laziness!

:-)

Best regards and thanks again,

Russ

On 8/7/2012 9:27 AM, Scott Hernandez wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
craiggwilson  
View profile  
 More options Aug 7 2012, 12:13 pm
From: craiggwilson <craiggwil...@gmail.com>
Date: Tue, 7 Aug 2012 09:13:41 -0700 (PDT)
Local: Tues, Aug 7 2012 12:13 pm
Subject: Re: Encrypting Mongo document contents

Hi Russell,
  Might I ask if you are a payment provider or gateway? If not, then the
best general advice I can give you from experience is to simply NOT store
any credit card related information at all and rely on your payment
provider/gateway to do that for you (PayPal, authorize.net, etc...).  If
you must store some information, then name and last4 with a link to the
corresponding identifier in your payment gateway is almost always
sufficient and these values do not need to be encrypted.  Just as important
in not storing cardholder data (Name, Number, CVV, ExpirationDate) is that
it is supposed to be encrypted all the way through the network stack (Level
7 through Level 1).  This obviously involves more than you and rely's on
good ops guys.  Hence, offloading all of this to your payment gateway takes
you almost completely out of the loop.

Hope that helpers...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »