Method IndexOfName NamespaceMongoDB.Bson AssemblyMongoDB.Bson.dll IndexOfName(string) Gets the index of an element. public virtual int IndexOfName(string name) Parameters name string The name of the element. Returns int The index of the element, or -1 if the element is not found.