Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21794

Array field limitation in query document [Only one array field may appear in the query document.]

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor - P4
    • Resolution: Duplicate
    • None
    • None
    • Querying
    • None

    Description

      Hello,

      Related page: https://docs.mongodb.org/manual/reference/operator/projection/positional/#array-field-limitation

      Actually I can figure it out why this limitation is present. The issue might be regarding other operations. Especially `update`.

      Is there any possibility of adding a new feature which providing usage of the second array field in the query document as a new feature in the feature?
      (maybe by using sub-operator like `$arr1` and `$arr2`)

      It seems as a private issue. However, cannot perform two-phase commits if an array value would be updated.

      For instance;

      	var query = { 
      		_id: t.customer_id, 
      		invoices: { $elemMatch: { 'year': t.year, 'month': t.month } }
      	        pendingTransactions: t._id
      	}
      	var update = {
      		'invoices.$.amount': 549,
      		$push: { pendingTransactions: t._id }
      	}
      	db.customers.update(query, update)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              efkan efkan turen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: