Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:58:43+00:00 2026-05-30T22:58:43+00:00

Given a very simple string[] , I am trying to accomplish the following in

  • 0

Given a very simple string[], I am trying to accomplish the following in a simple LINQ syntax with RavenDB.

public class Item {
   public string[] Tags { get; set; }
}
var list = new List<Item> {
  new Item { Tags = new string[] { "one", "two", "three" } },
  new Item { Tags = new string[] { "one", "two" } },
  new Item { Tags = new string[] { "one" } }
};

And then I can easily query this, like so;

var items = session.Query<Item>().Search( n => n.Tags, "one" ).Take(3).ToList();

This lets me easily get all of the items with a tag in their string[] that I want, but I want to do the opposite (obviously, for my use case the scenario is a lot more complicated, I am condensing it for this example).

I want to write a LINQ query that will work with Raven that will give me all of the objects that do not have a given tag. Like an ‘inverted’ search.

Contains() was removed from RavenDB, so I cannot use an inverse boolean on it. Until now, I just have to do a query, then use another LINQ command on the result, which I feel is highly inefficient. Does anyone know how to accomplish this?

I am also posting this on the RavenDB Google Groups Mailing List.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:58:44+00:00Added an answer on May 30, 2026 at 10:58 pm
    Session.Query<Item>()
           .Where(x => !x.Tags.Any(tag => tag == "one"))
           .ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am really struggling trying to get something very simple achieved. Essentially, I have
I'm getting the following error when trying to build my very simple webservice project.
I'm trying to compile a very simple c++ code and get a linking error
This very simple code gives me tons of errors: #include <iostream> #include <string> int
There's something very unsatisfactory about this code: /* Given a command string in which
I'm trying to do some very basic time math - basically, given inputs of
I'm having a very hard time trying to do something very simple. Here's the
All I'm trying to do is open a very simple application that is supposed
I'm trying to get a regex which is able to find the following part
Trying to do very simple thing. Have too many of these fields: <input name=itempriceqty0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.